diff --git a/README.md b/README.md index 75595d9..2664e8d 100644 --- a/README.md +++ b/README.md @@ -1,28 +1,57 @@ # Viridis -Welcome to your new gem! In this directory, you'll find the files you need to be able to package up your Ruby library into a gem. Put your Ruby code in the file `lib/viridis`. To experiment with that code, run `bin/console` for an interactive prompt. +The viridis gem is a set of helpers to generate viridis (viridis, magma, inferno, plasma) color palettes. -TODO: Delete this and the text above, and describe your gem +> This repo was inpired on https://github.com/d3/d3-scale-chromatic ## Installation Add this line to your application's Gemfile: ```ruby -gem 'viridis' +gem 'viridis', github: 'max2320/viridis' ``` And then execute: +```sh +$ bundle install +``` +Or install it yourself as: +```sh +$ gem install viridis git: 'https://github.com/max2320/viridis' +``` +## Usage - $ bundle install +Generating palette colors -Or install it yourself as: +#### Viridis palette +```ruby +Viridis.range(10) +``` +[ +"#440154", "#482878", "#3e4989", "#31688e", "#26828e", "#1f9e89", "#35b779", "#6ece58", "#b5de2b", "#fde725"] - $ gem install viridis +#### Magma palette +```ruby +Viridis::Magma.range(10) -## Usage +``` +> ["#000004", "#180f3d", "#440f76", "#721f81", "#9e2f7f", "#cd4071", "#f1605d", "#fd9668", "#feca8d", "#fcfdbf"] + +#### Inferno palette +```ruby +Viridis::Inferno.range(10) + +``` +> ["#000004", "#1b0c41", "#4a0c6b", "#781c6d", "#a52c60", "#cf4446", "#ed6925", "#fb9b06", "#f7d13d", "#fcffa4"] + +#### Plama palette +```ruby +Viridis::Plasma.range(10) + +``` +> ["#0d0887", "#46039f", "#7201a8", "#9c179e", "#bd3786", "#d8576b", "#ed7953", "#fb9f3a", "#fdca26", "#f0f921"] -TODO: Write usage instructions here ## Development diff --git a/viridis.gemspec b/viridis.gemspec index def2432..63a6d7a 100644 --- a/viridis.gemspec +++ b/viridis.gemspec @@ -12,8 +12,6 @@ Gem::Specification.new do |spec| spec.license = "MIT" spec.required_ruby_version = Gem::Requirement.new(">= 2.3.0") - spec.metadata["allowed_push_host"] = "TODO: Set to 'https://github.com/max2320/viridis'" - spec.metadata["homepage_uri"] = spec.homepage spec.metadata["source_code_uri"] = "https://github.com/max2320/viridis" spec.metadata["changelog_uri"] = "https://github.com/max2320/viridis"