Re: [csswg-drafts] `<absolute-color-base>` not enough anymore (#9555)

Okay, I think I see the confusion.

In the [`override-colors`](https://drafts.csswg.org/css-fonts-4/#descdef-font-palette-values-override-colors) descriptor, use of a non-absolute color makes the **descriptor** invalid. The current text could be understood to mean that the color itself is invalid, and I think that was your interpretation.

Colors which are not absolute are perfectly fine in general, they just require special handling. 

For example, 

- [`<system-color>`](https://drafts.csswg.org/css-color-4/#typedef-system-color)
- [`<light-dark()>`](https://drafts.csswg.org/css-color-5/#funcdef-light-dark) 
- [`<contrast-color()>`](https://drafts.csswg.org/css-color-5/#funcdef-contrast-color)

depend on the color mode, which can vary per element. So the result of `color-mix()` for example will depend on the element on which is is applied.

For example, inside `color-mix`, if  `currentColor` is used, the procedure to resolve the `currentColor` value is [given](https://drafts.csswg.org/css-color-4/#resolving-other-colors) 

> The [currentcolor](https://drafts.csswg.org/css-color-4/#valdef-color-currentcolor) keyword computes to itself.

> In the [color](https://drafts.csswg.org/css-color-4/#propdef-color) property, the used value of currentcolor is the resolved [inherited value](https://drafts.csswg.org/css-cascade-5/#inherited-value). In any other property, its used value is the used value of the color property on the same element.

in consequence, in 10.1. Resolving [color-mix()](https://drafts.csswg.org/css-color-5/#funcdef-color-mix) Values:

> If all [<color>](https://drafts.csswg.org/css-color-5/#typedef-color) parameters resolve to the corresponding colors in their respective color spaces, the computed value is the mixed color, in the specified mixing color space, resolved according to [CSS Color 4 §  14. Resolving <color> Values](https://drafts.csswg.org/css-color-4/#resolving-color-values). Otherwise (if [currentColor](https://drafts.csswg.org/css-color-4/#valdef-color-currentcolor) was used in the function), the computed value is the [color-mix()](https://drafts.csswg.org/css-color-5/#funcdef-color-mix) function with each <color> parameter resolved according to [CSS Color 4 §  14. Resolving <color> Values](https://drafts.csswg.org/css-color-4/#resolving-color-values), thus preserving inheritance into child elements.

and similarly in RCS, [10.2. Resolving Relative Color Syntax Values ](https://drafts.csswg.org/css-color-5/#resolving-rcs):

> If all [<color>](https://drafts.csswg.org/css-color-5/#typedef-color) parameters resolve to the corresponding colors in their respective color spaces, the computed value is the absolute <color> value, in the specified RCS color space, resolved according to [CSS Color 4 §  14. Resolving <color> Values](https://drafts.csswg.org/css-color-4/#resolving-color-values).

> Otherwise (if [currentColor](https://drafts.csswg.org/css-color-4/#valdef-color-currentcolor) was used in the function), the computed value is the Relative Color Syntax function with the origin [<color>](https://drafts.csswg.org/css-color-5/#typedef-color) parameter resolved according to [CSS Color 4 §  14. Resolving <color> Values](https://drafts.csswg.org/css-color-4/#resolving-color-values), thus preserving inheritance into child elements.

I think you were reading an "all non-absolute colors are invalid" into the specification, which was not the intent.

Reviewing that text it is clear that 10.1 and 10.2 were written with primarily `currentColor` in mind. `system-color`, `light-dark` and `contrast-color` resolve to the corresponding colors in their respective color spaces, so that is fine too.

But we do need an addition to call out the used value of `device-cmyk` in `color-mix()`. Probably with an example that shows a 100% mix of a `device-cmyk()` value results in whatever the fallback color is, not the original color.

And 6. Uncalibrated CMYK Colors: the [device-cmyk()](https://drafts.csswg.org/css-color-5/#funcdef-device-cmyk) Function needs an explicit mention (rather than inferring from omission in 4. Relative Colors ) that `device-cmyk()` cannot be used in RCS, and that doing so makes the RCS invalid.



-- 
GitHub Notification of comment by svgeesus
Please view or discuss this issue at https://github.com/w3c/csswg-drafts/issues/9555#issuecomment-2824800621 using your GitHub account


-- 
Sent via github-notify-ml as configured in https://github.com/w3c/github-notify-ml-config

Received on Wednesday, 23 April 2025 16:02:01 UTC