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

RGBA fails to parse if alpha is missing #274

Open
ebshimizu opened this issue Jan 9, 2024 · 0 comments
Open

RGBA fails to parse if alpha is missing #274

ebshimizu opened this issue Jan 9, 2024 · 0 comments

Comments

@ebshimizu
Copy link

According to the CSS spec the alpha parameter in the rgba color string is optional:

<modern-rgba-syntax> = rgba( [ <number> | <percentage> | none ]{3} [ / [ <alpha-value> | none ] ]? )

Tinycolor fails to parse cases where rgba() colors string have no alpha because it expects exactly four values when it should be expecting three and an optional fourth:

rgba: new RegExp("rgba" + PERMISSIVE_MATCH4),

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