Skip to content

[css-color-4] Clarify that none is allowed in calculations #13752

@cdoublev

Description

@cdoublev

Discussions and resolutions in #10151, #10211, #10280, suggest that none is allowed in calculations in color functions, with examples explicitly using none inside a math function, which seems unspecified, as opposed to RCS component keywords (emphasize added):

If an origin color is specified, the remaining arguments can either be specified directly, as normal, or be specified as a component keyword referring to one of the components of the origin color converted to the color space of the relative color. Math functions can also use these keywords to do dynamic modifications of the origin color’s components.

Within a relative color syntax rgb() or rgba() function, the allowed component keywords are:

  • r, g, and b [...]
  • alpha [...]

This does not seem to be backed by any test on WPT, or supported in current versions of Chrome and FF (ESR).

Of course, if a relative color uses a math function containing a component keyword representing a channel value of the origin color that is specified with none, resolving the math function will require resolving none. But this does not imply allowing it in calculations, as long as it does not show up in the serialization of the resolved color value (the declared color value preserves the specified component keywords).

And I do not see how allowing it can be useful to authors.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions