Qix-/color

Do you want to work on this issue?

You can request for a bounty in order to promote it!

rgb with only two params incorrectly parse color #234

gerdasi posted onGitHub

Hey!

I'm using color package and have some local tests for invalid user input check. After recent release (4.0.2) couple of my tests started failing. Previously rgb(255,2) color was invalid and now it returns [25, 5, 2]. The same goes for rgba(255,0) - it returns [25, 5, 0].

Is this expected behaviour? As far as I know, it should be invalid syntax 🤔 . Thanks! 🙏


Seems like it's not related to color package because downgrading versions didn't help.

posted by gerdasi over 3 years ago

rgb(255,2) is not valid syntax, right. Can you show me exactly what you're using to instantiate Color? This might be a color-string bug as I just upgraded a number of things over there. Downgrading color probably wouldn't do much.

posted by Qix- over 3 years ago

<img width="289" alt="Screenshot 2021-11-30 at 20 33 28" src="https://user-images.githubusercontent.com/10008149/144106940-28758fc3-4c25-4365-9239-b45c0afa7590.png">

can be reproduced with latest npm install color

posted by mastertheblaster over 3 years ago

Yep, confirmed - this should be erroring. Regression introduced in 85e6f53831a6689a289e52766b49c8fafa6ec3eb - I'll move this over to the color-string repository.

posted by Qix- over 3 years ago

Fund this Issue

$0.00
Funded
Only logged in users can fund an issue

Pull requests