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

> OTOH if we do not, how does that interpolate? Does it get converted to Infinity? What hue even is Infinity?

It's an error case, so it doesn't really matter so long as it's well-defined. (But per <https://drafts.csswg.org/css-values/#numeric-types>, it's defined to clamp to the nearest supported multiple of `360deg`, so it'll be red.  Note that this is the same behavior already defined in Color 4 for if you're interpolating between two colors that are *both* missing a hue, anyway.)

> Chris already gave you an example where the missing hue needs to be exposed: Converting any achromatic Lab color (e.g. lab(50 0 0)) to LCH.

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.

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

> Regardless, I think the ability of authors being able to define color components as missing to have them automatically take the other color's value is quite useful.

Sure, no complaints here; the d3 example seems quite compelling.

-- 
GitHub Notification of comment by tabatkins
Please view or discuss this issue at https://github.com/w3c/csswg-drafts/issues/6107#issuecomment-804617126 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 04:57:55 UTC