Skip to content

Function: readableColor()

ts
function readableColor(color): Color;

Defined in: readableColor.ts:12

Returns black or white depending on which provides better readability against the given background color.

Parameters

ParameterTypeDescription
colorColorthe background color

Returns

Color

#000000 if luminance >= 0.1791, #ffffff otherwise