Skip to content

Commit

Permalink
Doc Get hexadecimal color from a Gradient::Point
Browse files Browse the repository at this point in the history
  • Loading branch information
miguelms95 authored Mar 16, 2020
1 parent e33d4be commit a31b516
Showing 1 changed file with 11 additions and 0 deletions.
11 changes: 11 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -121,6 +121,17 @@ map.at(0.5)
# => #<Point 50.0 #80808080>
```

### Get hexadecimal color
You can get the hexadecimal color from a `Gradient::Point` with `.color.hex`, example:

```ruby
map = Gradient::Map.new(
Gradient::Point.new(0, Color::RGB.new(255, 255, 255), 1.0),
Gradient::Point.new(1, Color::RGB.new(226, 82, 82), 1.0)
)
map.at(0.5).color.hex
```

## Installation
Add this line to your application's Gemfile:

Expand Down

0 comments on commit a31b516

Please sign in to comment.