($hsl: string)
| 375 | const hslUnits = {'%': 100, 'deg': 360, 'rad': 2 * Math.PI, 'turn': 1}; |
| 376 | |
| 377 | function parseHSL($hsl: string): RGBA | null { |
| 378 | const [h, s, l, a = 1] = getNumbersFromString($hsl, hslRange, hslUnits); |
| 379 | if (h == null || s == null || l == null || a == null) { |
| 380 | return null; |
| 381 | } |
| 382 | return hslToRGB({h, s, l, a}); |
| 383 | } |
| 384 | |
| 385 | const C_A = 'A'.charCodeAt(0); |
| 386 | const C_F = 'F'.charCodeAt(0); |
no test coverage detected