Open avh4 opened 6 years ago
Given there aren't any clear use-cases documented yet, I think this can wait for consideration in 1.1.0.
I have a project in 0.18 that uses the old Color
package extensively. Its a paint drawing application (ctpaint.org/app). Here are some cases in that project where I think a Color
to 0-255 number string would be useful:
Color
in the Model
, but in the input fields, the Color
is represented as 0-255 numbers the user can modify. Color
type and draws colors from the palette onto a native JS canvas, which is in the format of 0-255 numbers. To do the drawing operations in the paint program I need to translate from the Color
as its stored in the palette to the 0-255 number format for the canvas.The simplest use case is to use it with elm-css. At the moment this is quite inconvenient.
Questions:
Currently, there is
toHex
, which does the conversion to integers, but only provides the result as a hex string. Is this sufficient for common needs? It is also currently possible to usetoRgba
and convert the components yourself using(*) 255 >> round
.We could possibly add something like the following: