Skip to content

RGBA fails to parse if alpha is missing #274

Open
@ebshimizu

Description

@ebshimizu

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),

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions