Socket
Book a DemoInstallSign in
Socket

phlox

Package Overview
Dependencies
Maintainers
1
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

phlox

0.1.1
bundlerRubygems
Version published
Maintainers
1
Created
Source

Phlox

A gem for creating generative gradient art. In brief, here's how it works:

  • Three trees of mathematical expressions are randomly generated
  • These expression trees are used to evaluate the (r, g, b) color of each (x, y) pair in the grid
  • The color values for each spot in the grid are turned into pixels on an image It works surprisingly well, and an infinite amount of interesting images can be made.

Here are some examples of what phlox can generate: Gradient art Gradient art Gradient art Gradient art Gradient art Gradient art Gradient art Gradient art Gradient art Gradient art Gradient art See the art/ directory for more images.

Installation

Add this line to your application's Gemfile:

gem 'phlox'

And then execute:

$ bundle

Or install it yourself as:

$ gem install phlox

Usage

You can use the Phlox::gen_pic method to generate a gradient art image. All parameters to this method are optional and have default values.

gem 'phlox'

# generate a 255x255 gradient, scale it by 3, and write it to "out.png"
Phlox::gen_pic width: 255, height: 255, fpath: "out.png", scale: 3

Development

After checking out the repo, run bin/setup to install dependencies. You can also run bin/console for an interactive prompt that will allow you to experiment.

To install this gem onto your local machine, run bundle exec rake install. To release a new version, update the version number in version.rb, and then run bundle exec rake release, which will create a git tag for the version, push git commits and tags, and push the .gem file to rubygems.org.

Contributing

Bug reports and pull requests are welcome on GitHub at https://gitlab.com/Bleu-Box/phlox.

FAQs

Package last updated on 05 Aug 2019

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

About

Packages

Stay in touch

Get open source security insights delivered straight into your inbox.

  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc

U.S. Patent No. 12,346,443 & 12,314,394. Other pending.