(value: string)
| 656 | } |
| 657 | |
| 658 | static parse(value: string): HSLColor | void { |
| 659 | let m: RegExpMatchArray | null; |
| 660 | if ((m = value.match(HSL_REGEX))) { |
| 661 | const [h, s, l, a] = (m[1] ?? m[2]).split(',').map(n => Number(n.trim().replace('%', ''))); |
| 662 | return new HSLColor(normalizeHue(h), clamp(s, 0, 100), clamp(l, 0, 100), clamp(a ?? 1, 0, 1)); |
| 663 | } |
| 664 | } |
| 665 | |
| 666 | toString(format: ColorFormat | 'css' = 'css') { |
| 667 | switch (format) { |
nothing calls this directly
no test coverage detected