Skip to content

[css-color] Range of color parameters to the color() function is inconsistent #2021

Closed
@faceless2

Description

@faceless2

Referring to example 9 at https://drafts.csswg.org/css-color/#icc-colors:

This example specifies four profiled colors: for a standard CMYK press, for a wide-gamut seven-ink printer, for ProPhoto RGB, and for the P3 standard RGB space.
color: color(swopc 0 206 190 77);
color: color(indigo 24 160 86 42 0 18 31);
color: color(prophoto 233 150 122);
color: color(p3 97 253 36);

The range of the parameters to the color() function is unclear. The examples show what appears to be a range of 0..255, for example color(prophoto 233 150 122), but this contrasts with the predefined spaces "srgb", "rec2020" and "image-p3", all of which have a range of 0..1.

A range from 0..1 is more natural for most colorspaces, or at least is more natural than 0..255. So I'm hoping that the examples simply need updating and should read more like color(prophoto 0.8 0.65 0.49). If this is the case then - although it's syntactic sugar - allowing a percentage as a synonym for 0..1 may be more natural, e.g. color(swopc 0 85% 70% 42%)

There will be spaces where 0..1 is inappropriate - I'm thinking specifically of Lab here. How this is handled would need to be discussed further, but for everything else, it's important to define the range consistently.

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions