Skip to content

Function: isLight() ​

ts
function isLight(hex): boolean;

Returns true if the hex color is perceptually light (luminance > 0.5).

Parameters ​

ParameterType
hexstring

Returns ​

boolean

Example ​

ts
isLight('#ffffff') // => true
isLight('#000000') // => false

Since ​

1.0.0

Released under the MIT License.