(r: number, g: number, b: number)
| 1168 | } |
| 1169 | |
| 1170 | function formatHex(r: number, g: number, b: number): string { |
| 1171 | const toHex = (n: number) => n.toString(16).padStart(2, '0') |
| 1172 | return `#${toHex(r)}${toHex(g)}${toHex(b)}` |
| 1173 | } |
| 1174 | |
| 1175 | export function canonicalizeColor(value: string): string | null { |
| 1176 | if (value.startsWith('#')) { |
no test coverage detected