Skip to content

Commit 95e764e

Browse files
committed
Update color table for accuracy
1 parent b5cb53e commit 95e764e

File tree

1 file changed

+16
-16
lines changed

1 file changed

+16
-16
lines changed

lib/scenic/color.ex

Lines changed: 16 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -156,6 +156,13 @@ defmodule Scenic.Color do
156156
yellow_green: {0x9A, 0xCD, 0x32}
157157
}
158158

159+
@g :color_g
160+
@ga :color_ga
161+
@rgb :color_rgb
162+
@rgba :color_rgba
163+
@hsv :color_hsv
164+
@hsl :color_hsl
165+
159166
@moduledoc """
160167
APIs to create and work with colors.
161168

@@ -180,15 +187,15 @@ defmodule Scenic.Color do
180187
For HSL and HSV, h is a float between 0 and 360, while the s, v and l values
181188
are floats between 0 and 100.
182189

183-
| Format | Implicit | Explicit |
184-
|----------------------------|----------------|---------------------------|
185-
| Named Color | *na* | See the Named Color Table |
186-
| Grayscale | `g` | `{:g, g}` |
187-
| Gray, Alpha | `{g, a}` | `{:g, {g, a}}` |
188-
| Red, Green, Blue | `{r, g, b}` | `{:rgb, {r, g, b}}` |
189-
| Red, Green, Blue, Alpha | `{r, g, b, a}` | `{:rgba, {r, g, b, a}}` |
190-
| Hue, Saturation, Value | *na* | `{:hsv, {h, s, v}}` |
191-
| Hue, Saturation, Lightness | *na* | `{:hsl, {h, s, l}}` |
190+
| Format | Implicit | Explicit |
191+
|----------------------------|----------------|-----------------------------|
192+
| Named Color | *na* | See the Named Color Table |
193+
| Grayscale | `g` | `{:#{@g}, g}` |
194+
| Gray, Alpha | `{g, a}` | `{:#{@ga}, {g, a}}` |
195+
| Red, Green, Blue | `{r, g, b}` | `{:#{@rgb}, {r, g, b}}` |
196+
| Red, Green, Blue, Alpha | `{r, g, b, a}` | `{:#{@rgba}, {r, g, b, a}}` |
197+
| Hue, Saturation, Value | *na* | `{:#{@hsv}, {h, s, v}}` |
198+
| Hue, Saturation, Lightness | *na* | `{:#{@hsl}, {h, s, l}}` |
192199

193200

194201
## Named Colors
@@ -218,13 +225,6 @@ defmodule Scenic.Color do
218225

219226
# import IEx
220227

221-
@g :color_g
222-
@ga :color_ga
223-
@rgb :color_rgb
224-
@rgba :color_rgba
225-
@hsv :color_hsv
226-
@hsl :color_hsl
227-
228228
@type implicit ::
229229
atom
230230
| {name :: atom, a :: integer}

0 commit comments

Comments
 (0)