Skip to content

[css-color-5] RCS channel keywords interaction with calc() is underspecified #10280

Open
@weinig

Description

@weinig

The behavior of the RCS channel keywords and calc() is underspecified in a few ways.

  1. It is unclear when the keyword should resolve to their numeric values.

CSS Values 4 requires specifications, like CSS Color 5, that define additional keywords for calc, to include the following:

Each specifications defining such keywords must define for each keyword:

  • its value
  • its type (<number>, <length>, etc)
  • when it resolves (parse time, computed-value time, or used-value time)

(https://drafts.csswg.org/css-values-4/#calc-variables)

CSS Color 5 does do the first two.

The answer here will depend on if the origin is currentcolor, as in that case, the specified value serialization could not be the numeric value, but in the general case, it's still unclear. Should the specified value serialization of color(from blue srgb calc(r) calc(g) calc(b)) be color(from blue srgb calc(r) calc(g) calc(b)) or color(from blue srgb 0 0 1)?

  1. It is unclear what to do about missing components in the origin color.

For example, take: color(from color(srgb none none none) srgb r calc(g) calc(b * 2)).

How should this be interpreted?

Should the none be carried forward for the bare identifier but not calc?: color(srgb none 0 0)
Should the none be carried forward for the bare identifier and calc? If so, what is none * 2 evaluate to?

An additional edge case to consider and clarify is for when the alpha value of the origin color is used as the default: color(from color(srgb none none none / none) srgb 0 0 0)

Should that resolve to color(srgb 0 0 0 / none)?

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

Status

Wednesday morning

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions