Sign In

$isDarkColor[]

Checks if a color is dark based on luminance (returns true/false).

New v1.0.1+ Requires Brackets

Usage

$isDarkColor[;]
Also callable as
$isDark $isColorDark

Arguments

NameTypeRequiredDescription
color
StringYesThe color code to check.
threshold
NumberNoOverride default luminance cutoff (0–1, default 0.5).

Output

Boolean

Was this page helpful?