Function: isColor()
isColor(
value):value is AnyColor
Defined in: functions/isColor.ts:21
Checks if the given value is a valid color.
To check for specific color types, use one of these instead: isDecimalColor, isHexColor, isRgbColor, isHslColor, or isCmykColor.
Parameters
value
any
The value to check.
Returns
value is AnyColor
True if the value is a valid color, false otherwise.
Example
isColor('#ff0000'); // true
isColor({ r: 255, g: 0, b: 0 }); // true
isColor('not a color'); // false