[csswg-drafts] [css-color] Extend semantics of color adjusters “saturation” and “lightness”?

gasrios has just created a new issue for https://github.com/w3c/csswg-drafts:

== [css-color] Extend semantics of color adjusters “saturation” and “lightness”? ==
Section 14 of “CSS Color Module Level 4” (https://drafts.csswg.org/css-color/#modifying-colors) defines two color adjusters, “saturation” and “lightness”, “when base color is interpreted as an HSL”.

While HSL is more intuitive to use than RGB when transforming a color, it is also perceptually non-uniform: for example, a human observer will not perceive “hsl(0deg 100% 50%)” (red) and “hsl(240deg 100% 50%)” (blue) to have the same levels of lightness and saturation. Perceptually uniform color spaces like CIELab do not have this problem, but the spec does not define color adjusters for them.

If the spec supports transformations like “color-mod(lab(50, 80, 67), saturation(-10%))” or “color-mod(lch(50, 100, 40), lightness(-10%)), saturation(-10%))” by first converting the color specified in LCH to HSL, there is no guarantee the resulting color will have the desired appearance.

Would it make sense to overload the color adjusters “saturation” and “lightness” so they support different transformations for perceptually uniform and non-uniform color spaces?

If so, there is another problem: CIELab has no saturation definition, so there is no correct way to handle the associated color adjuster in it. Furthermore, as “chroma” and “lightness” are not independent from one another (CIE defines “chroma” as “colorfulness of an area judged as a proportion of the brightness of a similarly illuminated area that appears white or highly transmitting”), changes in lightness will also affect the saturation of a color, and this cannot be corrected in a color space that does not formally define saturation.

One alternative would be to add support to CIELuv, which defines saturation, and handle the perceptually uniform color adjusters using this color space. CIELuv also has a cylindrical representation, therefore the perceptually uniform color adjusters can be trivially defined in it.

The only point of attention is, as stated above, to remember that changes in lightness must be reflected in chroma (”colorfulness of an area judged as a proportion of the brightness of **a similarly illuminated area** that appears white or highly transmitting”), so saturation (“colourfulness of an area judged **in proportion to its brightness**”) remains unchanged.

Please view or discuss this issue at https://github.com/w3c/csswg-drafts/issues/1610 using your GitHub account

Received on Tuesday, 18 July 2017 13:03:39 UTC