(value: string)
| 21 | } |
| 22 | |
| 23 | export function getHexColorDigitCount(value: string) { |
| 24 | const trimmed = value.trim(); |
| 25 | if (trimmed.length === 0) return 0; |
| 26 | |
| 27 | const raw = trimmed.startsWith("#") ? trimmed.slice(1) : trimmed; |
| 28 | if (!/^[\dA-F]+$/i.test(raw)) return 0; |
| 29 | |
| 30 | return raw.length; |
| 31 | } |
| 32 | |
| 33 | export function normalizeOpaqueHexColor(value: string) { |
| 34 | const normalized = normalizeHexColor(value); |
no outgoing calls
no test coverage detected