Colors
colorIsLight

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

Syntax

import { colorIsLight } from '@opentf/std';
 
colorIsLight(input: any): boolean

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

Examples

colorIsLight('white'); //=> true
colorIsLight('black'); //=> false
colorIsLight('yellow'); //=> true

Try