Skip to content

[css-color] add xyy and/or xyz functions #815

@dpk

Description

@dpk

I think there should be a way to specify colours by direct reference to coordinates in the CIE 1931 xyY and/or XYZ systems.

Use case: These spaces may not be intuitive for human authors, but for scripts which generate colours out of some other, non-CSS-supported colour space, most of them will be converting to xyY or XYZ and then to sRGB or P3 or Rec.2020; they could reduce the chance of errors in their own code, and duplication of code which doubtless already exists in the user-agent (which, undoubtedly, will be converting from e.g. sRGB to P3 by going through xyY or XYZ, and thus already knows how to convert from these spaces to the display target space), by simply avoiding the last step. Converting to Lab or LCH for these purposes has the same problem of being potentially bug-prone and being an ultimately unnecessary transformation.

If the specified colour is outside the target gamut of the stylesheet the rule should be invalid. Though I see that this involves making the validity of rules dependent on the gamut of the output device, hmm.

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions