Skip to content

Commit

Permalink
docs
Browse files Browse the repository at this point in the history
  • Loading branch information
max2320 committed Nov 15, 2020
1 parent 7dad310 commit a3acf2d
Show file tree
Hide file tree
Showing 2 changed files with 37 additions and 10 deletions.
45 changes: 37 additions & 8 deletions README.md
Original file line number Diff line number Diff line change
@@ -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)
```
[
<span style="background-color: #440154;">"#440154"</span>, <span style="background-color: #482878;">"#482878"</span>, <span style="background-color: #3e4989;">"#3e4989"</span>, <span style="background-color: #31688e;">"#31688e"</span>, <span style="background-color: #26828e;">"#26828e"</span>, <span style="background-color: #1f9e89;">"#1f9e89"</span>, <span style="background-color: #35b779;">"#35b779"</span>, <span style="background-color: #6ece58;">"#6ece58"</span>, <span style="background-color: #b5de2b;">"#b5de2b"</span>, <span style="background-color: #fde725;">"#fde725"</span>]

$ gem install viridis
#### Magma palette
```ruby
Viridis::Magma.range(10)

## Usage
```
> [<span style="background-color: #000004">"#000004"</span>, <span style="background-color: #180f3d">"#180f3d"</span>, <span style="background-color: #440f76">"#440f76"</span>, <span style="background-color: #721f81">"#721f81"</span>, <span style="background-color: #9e2f7f">"#9e2f7f"</span>, <span style="background-color: #cd4071">"#cd4071"</span>, <span style="background-color: #f1605d">"#f1605d"</span>, <span style="background-color: #fd9668">"#fd9668"</span>, <span style="background-color: #feca8d">"#feca8d"</span>, <span style="background-color: #fcfdbf">"#fcfdbf"</span>]
#### Inferno palette
```ruby
Viridis::Inferno.range(10)

```
> [<span style="background-color: #000004">"#000004"</span>, <span style="background-color: #1b0c41">"#1b0c41"</span>, <span style="background-color: #4a0c6b">"#4a0c6b"</span>, <span style="background-color: #781c6d">"#781c6d"</span>, <span style="background-color: #a52c60">"#a52c60"</span>, <span style="background-color: #cf4446">"#cf4446"</span>, <span style="background-color: #ed6925">"#ed6925"</span>, <span style="background-color: #fb9b06">"#fb9b06"</span>, <span style="background-color: #f7d13d">"#f7d13d"</span>, <span style="background-color: #fcffa4">"#fcffa4"</span>]
#### Plama palette
```ruby
Viridis::Plasma.range(10)

```
> [<span style="background-color: #0d0887">"#0d0887"</span>, <span style="background-color: #46039f">"#46039f"</span>, <span style="background-color: #7201a8">"#7201a8"</span>, <span style="background-color: #9c179e">"#9c179e"</span>, <span style="background-color: #bd3786">"#bd3786"</span>, <span style="background-color: #d8576b">"#d8576b"</span>, <span style="background-color: #ed7953">"#ed7953"</span>, <span style="background-color: #fb9f3a">"#fb9f3a"</span>, <span style="background-color: #fdca26">"#fdca26"</span>, <span style="background-color: #f0f921">"#f0f921"</span>]
TODO: Write usage instructions here

## Development

Expand Down
2 changes: 0 additions & 2 deletions viridis.gemspec
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down

0 comments on commit a3acf2d

Please sign in to comment.