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

Fix hex7 is treated as a valid color #29

Closed subzey closed 3 years ago

subzey commented 3 years ago

The part of a regular expression ([0-9A-F]{3,4}){1,2} works not the way you could probably expect. It's not

[0-9A-F]{3} [0-9A-F]{3} | [0-9A-F]{4} [0-9A-F]{4}

it's

[0-9A-F]{3,4} [0-9A-F]{3,4}

So the invalid "HEX7" could sneak in.

omgovich commented 3 years ago

Wow, good catch! Thanks a lot!