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

new Color() accepts serialized coordinates with right paren as separator #614

Open
sidewayss opened this issue Dec 8, 2024 · 0 comments

Comments

@sidewayss
Copy link
Contributor

sidewayss commented Dec 8, 2024

Not sure if the title is the correct cause or way to phrase it. I'm submitting this based on this Q&A comment and @LeaVerou's response in the next comment.

This creates a valid Color instance using the right paren as an arg separator for color():

new Color("color(--lchuv 86.8% 42.9)230)")

For reference, this throws:

new Color("color(--lchuv 86.8% 42.9)")

Are !@#$%^&*[]{}(= legitimate separators? (that's not necessarily a complete list) You can chain as many of those as you like after a number and the coordinates are properly converted. For example, this works:

new Color("color(--lchuv 86.8{[]}(#!42.9 230)")
@sidewayss sidewayss changed the title new Color() accepts serialized coordinates with invalid units new Color() accepts serialized coordinates with right paren as separator Dec 8, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant