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 opacity #33

Closed Semigradsky closed 3 years ago

Semigradsky commented 3 years ago
colord('rgb(29 164 192 / 95%)')
colord('rgb(29 164 192 / 0.95)')
// r {
//   parsed: { r: 29, g: 164, b: 192, a: 1 },
//   rgba: { r: 29, g: 164, b: 192, a: 1 }
// }

But works with old syntax (with commas):

colord('rgb(29, 164, 192, 0.95)')
// r {
//   parsed: { r: 29, g: 164, b: 192, a: 0.95 },
//   rgba: { r: 29, g: 164, b: 192, a: 0.95 }
// }
omgovich commented 3 years ago

Hi, thanks for the issue! I didn't implement all CSS notations yet but will do that soon. Probably in a few days. Will let you once it's done 🤝

omgovich commented 3 years ago

Fixed in v1.3.1 🚀