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