Re: [csswg-drafts] [css-color-4] Premultiplication in cylindrical spaces and mixing (#11238)

There seem to be a few possible issues here. One is whether the `over` operator is defined over arbitrary color spaces or a select few, and if the former, how it should be defined for cylindrical color spaces. From what @svgeesus has said, the answer is the latter, so that may be the end of the story for this issue. (We may choose to define `over` in the `color` crate for more spaces anyway, but that needn't concern us here)

I'm still not convinced that holding out hue from premultiplication is not needless complexity that makes things worse, though it's also possible I'm missing something. In particular, I don't follow the argument above. To me, the interpretation of premultiplied color components has an implicit division by alpha. The premultiplied component vector for `oklch(0.5 0.2 85 / 50%)` is [0.25, 0.1, 42.5, 0.5], which thus has a hue angle of 85 degrees, not 42.5.

Holding out premultiplication of hue, the result of a 50% lerp of `oklch(0.5 0.1 120 / 50%)` and `oklch(0.5 0.1 240)` is `oklch(0.5 0.1 180 / 75%)`. If hue were premultiplied, the result would be `oklch(0.5 0.1 200 / 75%)`, essentially giving more weight to the more opaque color. That actually seems better to me, in that I believe it's a more perceptually uniform ramp. As I say, I'm happy to prepare visual samples to argue for this position.

> gamma-encoded sRGB, to get the wrong but web-compatible result

I don't agree with the word "wrong" here, as I believe there is a case to be made that compositing in more perceptually uniform spaces is a useful design tool. In addition, compositing in device RGB is a much closer approximation to layering paint in the Kubelka-Munk model than doing it in a linear space. That may be an additional factor in the staying power of compositing in device color spaces, not just laziness of implementors. But perhaps that's a discussion for another day.

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


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

Received on Tuesday, 19 November 2024 15:50:41 UTC