(value: string)
| 501 | } |
| 502 | |
| 503 | static parse(value: string): HSBColor | void { |
| 504 | let m: RegExpMatchArray | null; |
| 505 | if ((m = value.match(HSB_REGEX))) { |
| 506 | const [h, s, b, a] = (m[1] ?? m[2]).split(',').map(n => Number(n.trim().replace('%', ''))); |
| 507 | return new HSBColor(normalizeHue(h), clamp(s, 0, 100), clamp(b, 0, 100), clamp(a ?? 1, 0, 1)); |
| 508 | } |
| 509 | } |
| 510 | |
| 511 | toString(format: ColorFormat | 'css' = 'css') { |
| 512 | switch (format) { |
nothing calls this directly
no test coverage detected