Skip to content

Function: isDark()

ts
function isDark(hex): boolean;

Returns true if the hex color is perceptually dark (luminance ≤ 0.5).

Parameters

ParameterType
hexstring

Returns

boolean

Example

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

Since

1.0.0

Released under the MIT License.