14 lines
286 B
TypeScript
14 lines
286 B
TypeScript
|
export const isValidColor = (color: string) => {
|
||
|
if (!color) return false;
|
||
|
if (
|
||
|
!color.startsWith('#') &&
|
||
|
!color.startsWith('rgb(') &&
|
||
|
!color.startsWith('hsl(') &&
|
||
|
!color.startsWith('hsv(')
|
||
|
) {
|
||
|
return false;
|
||
|
}
|
||
|
// TODO: check color values
|
||
|
return true;
|
||
|
};
|