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

Unable to parse color from rgb/rgba CSS color string #11264

Closed
aerialist7 opened this issue May 2, 2023 · 3 comments · Fixed by #11271
Closed

Unable to parse color from rgb/rgba CSS color string #11264

aerialist7 opened this issue May 2, 2023 · 3 comments · Fixed by #11271
Labels
good first issue An opportunity for first time contributors type - bug

Comments

@aerialist7
Copy link
Contributor

Hi Team,

I've found a problem with parsing color from CSS string.
You can find a sample below.
It works correctly only with comma-separated rgb-colors, but CSS color can be different.

Sandcastle example: link

Browser: Latest Chrome/Firefox/Safari

Operating System: MacOS/Windows

Hope it will be fixed, because it's strange that I put valid CSS color as a value, but it parsed incorrectly.

@aerialist7 aerialist7 changed the title Unable to parse color from CSS color string Unable to parse color from куCSS color string May 2, 2023
@aerialist7 aerialist7 changed the title Unable to parse color from куCSS color string Unable to parse color from rgb/rgba CSS color string May 2, 2023
@ggetz
Copy link
Contributor

ggetz commented May 3, 2023

Thanks for identifying this @aerialist7.

This would be a fairly minimal fix. The regex's in Color.js would need to be adjusted such that , becomes [,\s] to accept either a comma or a space. Then we would want to add a unit test or two to confirm the behavior is working.

Would you be able to contribute the fix?

@ggetz ggetz added good first issue An opportunity for first time contributors type - bug labels May 3, 2023
@aerialist7
Copy link
Contributor Author

Hi @ggetz, sure, will contribute it

@aerialist7
Copy link
Contributor Author

Hi @ggetz, please take a look on #11271

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
good first issue An opportunity for first time contributors type - bug
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants