Utilities for colors.
There are two competing color types in this library:
Color.Color
(from avh4/elm-color
)Color
(from mdgriffith/elm-ui
)The default color type is Color
.
fromColorColor : Color -> Element.WithContext.Color
Transform a Color.Color
into an Color
.
toColorColor : Element.WithContext.Color -> Color
Transform an Color
into a Color.Color
.
fromHex : String -> Element.WithContext.Color
Convert a string containing an hexadecimal number into an Color
.
fromLightToDark : Color -> Color
Convert a color from Light Mode to Dark Mode. This function works for Color.Color
type.
setAlpha : Basics.Float -> Color -> Color
Change the alpha channel in a color. This function works for Color.Color
type.
toCssRgba : Element.WithContext.Color -> String
Convert an Color
to a RGBA string, for example: rgba(100, 200, 0, 1)
fromHexToColorColor : String -> Color
Convert a string containing an hexadecimal number into a Color.Color
.