This module contains functions to adapt color in various ways.
We use the CIELCH color space, while the material design on chrome uses sRGB. CIELCH colors ensure that the result of mixing colors looks natural, where as sRGB is optimized to mix images together.
In practice this means that in edge-cases our package will produce better results, then the javascript material design implementation.
Opacity value for a focused button
Opacity value for a pressed button
Opacity value for a disabled button
Opacity value for a selected button
Returns either Black or White, depending of the input color.
Returns the first color, adapted to ensure accessibility rules.
accessibleTextColor bgColor
= accessibleWithTextColor (Color.rgb255 255 255 255) bgColorSimulates adding a color in front (subtractive color mixing).
--Darkens the color by 50%
withShade (Color.rgb255 255 255 255) 0.5
--Makes the color 50% more red
withShade (Color.rgb255 255 0 0) 0.5Multiply the opacity value by a given value
scaleOpacity (0.25 \* 2) ==
scaleOpacity 0.25 >> scaleOpacity 2dark gray
gray
Utility function to convert a color to CIELCH color space
Utility function to convert CIELCH color space back to a color
Returns a Material Design shadow
Opacity value for hovering over a button