Skip to content

[css-color-5] Grammar for parsing relative colors? #7721

Closed
@GPHemsley

Description

@GPHemsley

Is it just me, or is the grammar for parsing relative colors missing?

https://drafts.csswg.org/css-color-5/#relative-colors

Channel keywords are defined for each color function, and example usage is provided, but none of the channel keywords appear in the grammar for them.

For example, 3.1. Relative sRGB Colors defines the allowed channel keywords of rgb() as r, g, b, and alpha.

And Example 13 shows:

rgb(from indianred 255 g b)

But the grammar is listed as:

rgb() = rgb( [<percentage> | none]{3} [ / [<alpha-value> | none] ]? ) |
        rgb( [<number> | none]{3} [ / [<alpha-value> | none] ]? ) |
        rgb( [ from <color> ]? [ <number> | <percentage> | none]{3} [ / [<alpha-value> | none] ]?  )
<alpha-value> = <number> | <percentage>

Which makes no mention of r, g, b, or alpha.

It also describes the grammar for the functions like rgb() as being "extended", but it doesn't link to what it's extending, and indeed appears to be completely replacing the syntax from css-color-4, at least from a grammar definition standpoint.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Closed as Question AnsweredUsed when the issue is more of a question than a problem, and it's been answered.Commenter SatisfiedCommenter has indicated satisfaction with the resolution / edits.css-color-5Color modification

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions