omgovich / colord

👑 A tiny yet powerful tool for high-performance color manipulations and conversions
https://colord.omgovich.ru
MIT License
1.67k stars 49 forks source link

Incorrectly parse `hsl` if `hue` present in `angle` format #34

Closed Semigradsky closed 3 years ago

Semigradsky commented 3 years ago
colord('hsl(0deg 100% 50%)')
// r { parsed: null, rgba: { r: 0, g: 0, b: 0, a: 1 } }

But works if hue in number format:

colord('hsl(0 100% 50%)')
// r {
//   parsed: { r: 255, g: 0, b: 0, a: 1 },
//   rgba: { r: 255, g: 0, b: 0, a: 1 }
// }

Syntax: https://www.w3.org/TR/css-color-4/#hue-syntax

omgovich commented 3 years ago

Good catch, thanks! Will do that this week.

omgovich commented 3 years ago

Fixed in v1.3.1 🚀