[csswg-drafts] [css-color-4] HWB normalization under-specified? (#9228)

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

== [css-color-4] HWB normalization under-specified? ==
As [originally noted in another issue](https://github.com/w3c/csswg-drafts/issues/8318#issuecomment-1689829045) there is a lack of interop on the normalization of W and B values which sum to more than 100%.

The specification refers to normalization in passing, but does not explicitly define it, except by analogy (and also in the sample code):

> The resulting color can be thought of conceptually as a mixture of paint in the chosen hue, white paint, and black paint, with the relative amounts of each determined by the percentages. If white+black is equal to 100% (after normalization), it defines an achromatic color, i.e. some shade of gray, without any hint of the chosen hue. In this case, the hue component is [powerless](https://drafts.csswg.org/css-color-4/#powerless-color-component).

The sample code, though, expresses this differently: if white + black is greater than or equal to 100% return a shade of gray (the value depending on the proportion of white to black) else use the values without normalization (because we know they sum to less than 100%.

I had thought the spec was clear but re-reading it, maybe it is not.

I'm interested to understand the different reading that resulted in the Firefox and Safari implementations, which do not follow the sample code.


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


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

Received on Wednesday, 23 August 2023 12:48:41 UTC