☀️ Checks if a color is light based on its relative luminance.

Syntax

TypeScript
import { colorIsLight } from '@opentf/std';

colorIsLight(input: any): boolean

Returns true if the luminance is greater than or equal to 0.5.

Examples

TypeScript
colorIsLight('white'); //=> true
colorIsLight('black'); //=> false
colorIsLight('yellow'); //=> true
Last updated on
Edit this page