Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

rgb with only two params incorrectly parse color #65

Closed
gerdasi opened this issue Nov 30, 2021 · 8 comments
Closed

rgb with only two params incorrectly parse color #65

gerdasi opened this issue Nov 30, 2021 · 8 comments
Labels

Comments

@gerdasi
Copy link

gerdasi commented Nov 30, 2021

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! 🙏

@gerdasi
Copy link
Author

gerdasi commented Nov 30, 2021

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

@gerdasi gerdasi closed this as completed Nov 30, 2021
@Qix-
Copy link
Owner

Qix- commented Nov 30, 2021

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.

@Qix- Qix- reopened this Nov 30, 2021
@mastertheblaster
Copy link

Screenshot 2021-11-30 at 20 33 28

can be reproduced with latest npm install color

@Qix-
Copy link
Owner

Qix- commented Nov 30, 2021

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

@Qix- Qix- transferred this issue from Qix-/color Nov 30, 2021
@Qix- Qix- added the bug label Nov 30, 2021
@Qix- Qix- closed this as completed in 32f3e00 Nov 30, 2021
@Qix-
Copy link
Owner

Qix- commented Nov 30, 2021

Thanks for the report, sorry about that! Fix landed in 32f3e00, released as 1.8.2.

@mastertheblaster
Copy link

Thanks, seems it fixed the problem 💯

@Qix-
Copy link
Owner

Qix- commented Nov 30, 2021

No problem, thanks for confirming!

@gerdasi
Copy link
Author

gerdasi commented Dec 1, 2021

Thank you! 🎊

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants