Re: [csswg-drafts] [css-color-4] Achromatic colors converted to hue-ish spaces should treat hue as "missing", not NaN (#6107)

> I was asking for sample code because it wasn't clear to me how this would actually happen in a way that's author-exposed. Y'all just keep saying "when you convert a color", but as far as I can tell Color 4 doesn't have any way to do so that doesn't immediately fill in a hue anyway.

Most sample code for converting to polar coordinates will typically produce a random hue (typically 0)  for achromatic colors instead of declaring it as undefined or missing, but it would be more correct to produce a missing hue. Technically, even converting a gray sRGB color (e.g. `#777`) to HSL should also return a missing hue.

> I guess via Color 5's relative color syntax? `lch(from gray ...)`?

Yes, or `color-mix(in lch, gray 100%, ...)`.

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


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

Received on Tuesday, 23 March 2021 18:06:29 UTC