@flourish/utils-color
v2.0.0
Published
Flourish module handy color tools
Downloads
285
Maintainers
Keywords
Readme
flourish-utils-color
hexToColor(hex_string, opacity)
Converts hex to d3 color object as described here
hexToColor("#00ff00", 0.5); // {r: 0, g: 255, b: 0, a: 0.5}
hexToRgba(hex_string, opacity)
Converts hex to rgba string
hexToRgba("#00ff00", 0.5); // rgba(0, 255, 0, 0.5)
isPaleBackground(background_color)
Returns if color is pale or not as a background color, according to APCA color contrast checking.
isPaleText(text_color)
Returns if color is pale or not as a text color, according to APCA color contrast checking.