(value: string)
| 97 | |
| 98 | type RGB3 = [number, number, number]; |
| 99 | const isHexColor = (value: string): boolean => /^#[\da-fA-F]{6}$/.test(value); |
| 100 | const hexToRgb = (h: string): RGB3 => { |
| 101 | const x = h.replace("#", ""); |
| 102 | return [0, 2, 4].map((i) => Number.parseInt(x.slice(i, i + 2), 16)) as RGB3; |