Re: [csswg-drafts] [css-color-4] Do we actually need hwb()? (#6940)

> > And couldn't `hwb()` be seen as a shortcut for `color-mix()` in combination with `hsl()`? E.g. `hwb(240, 50%, 30%)` expressed with `color-mix()` is `color-mix(hsl(240, 0%, 0%), white 50%, black 30%))`, right?
> 
> See, that's _precisely_ what I’m worried about. No, it's not a shortcut for `color-mix()`. `color-mix(white X%, var(--color))` can produce any tint, whereas `hwb()` is restricted to the sRGB gamut.

Sure, but if you specify `in hsl` or `in rgb` you restrict it to sRGB.

> Note that `color-mix(hsl(240, 0%, 0%), white 50%, black 30%))` is invalid syntax, as the color space argument is mandatory and `color-mix()` only allows up to two colors. But assuming you meant `color-mix(in hsl, color-mix(in hsl, hsl(240, 0%, 0%), white 50%), black 30%)`, that would give you gray, not purple like `hwb(240 50% 30%)`, since you're mixing black with white and black…

What I wrote was total nonsense. My question was rather, how to express e.g. `hwb(240 50% 30%)` with `color-mix()` and/or `lch()`?

Sebastian

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


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

Received on Tuesday, 11 January 2022 21:50:31 UTC