Function: isHexColor()
isHexColor(
value):value is `#${string}`
Defined in: functions/isHexColor.ts:17
Checks if a value is a valid hexadecimal color string. A valid hex color can be in the format #RRGGBB, #RGB, #RRGGBBAA, or #RGBA.
Parameters
value
any
The value to check.
Returns
value is `#${string}`
True if the value is a valid hexadecimal color, false otherwise.
Examples
isHexColor('#ff0000'); // true
isHexColor({ r: 255, g: 0, b: 0 }); // false