@@ -156,6 +156,13 @@ defmodule Scenic.Color do
156
156
yellow_green: {0x9A, 0xCD, 0x32}
157
157
}
158
158
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
+
159
166
@moduledoc """
160
167
APIs to create and work with colors.
161
168
@@ -180,15 +187,15 @@ defmodule Scenic.Color do
180
187
For HSL and HSV, h is a float between 0 and 360, while the s, v and l values
181
188
are floats between 0 and 100.
182
189
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}}` |
192
199
193
200
194
201
## Named Colors
@@ -218,13 +225,6 @@ defmodule Scenic.Color do
218
225
219
226
# import IEx
220
227
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
-
228
228
@type implicit ::
229
229
atom
230
230
| {name :: atom, a :: integer}
0 commit comments