Re: [csswg-drafts] [css-color-4] [css-color-5] inconsistent mentions of powerless components in `white`. (#8609)

> @facelessuser are you sure that what you are seeing aren't implementation bugs :)
> I don't think we can use any browser implementation as a reference at this time.

Yes, I am certain. Mathematically, it makes no sense. Forget what it looks like. I use references only because visually can sometimes be easier to talk about, but in this case, let's just look at the math of the models.

Let's say I have `oklch(0 none none)` and blue which is `color(--oklch 0.45201 0.31321 264.05 / 1)`. Since black has two missing components, white adopts the blue's chroma and hue making it `oklch(0 0.31321 264.05)`. What do you think that color is?

Let's convert it to LCh for instance, we get a color with negative lightness.

```py
>>> Color('oklch(0 0.31321 264.05)').convert('lch')
color(--lch -5.3831 104.75 315.62 / 1)
```

The fact that the model allows you to convert it, doesn't mean it is a real, visible, and useful color.  It's not only out gamut, it's out of the visible spectrum. It has a negative luminance.

```py
>>> Color('oklch(0 0.31321 264.05)').convert('xyz-d65')['y']
-0.004737023320937883
```

Whatever it happens to map to visually once you coerce it into the real visible spectrum is irrelevant.

There is a reason that my implementation matches Safari, it's because what they are doing (in this specific interpolation case) makes sense. It's a nonsense color that they clip, and yes, you happen to get blue in OkLCh if visualized after forcing it to be visible via clipping, but whatever it looks like, it's a negative luminance color, it's a nonsense color.

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


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

Received on Thursday, 30 March 2023 12:01:32 UTC