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 percentage syntax for rgb/rgba #32

Closed Semigradsky closed 3 years ago

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

It is the same as rgb(0 255 0)

Syntax: https://www.w3.org/TR/css-color-4/#funcdef-rgb

omgovich commented 3 years ago

Fixed in v1.3.1 🚀