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