[csswg-drafts] [css-colors-4] Clip negative whiteness/blackness of `<hwb()>`? (#10368)

cdoublev has just created a new issue for https://github.com/w3c/csswg-drafts:

== [css-colors-4] Clip negative whiteness/blackness of `<hwb()>`? ==
Browsers serialize `hwb(0 -10 0)` with `rgb(255, 0, 0)`. The [conversion from hwb to rgb](https://drafts.csswg.org/css-color-4/#hwb-to-rgb) returns `[1, -0.1, -0.1]`.

Where is clipping now specified in the specification?

I presume it should still apply otherwise resolving `infinity` to `255` after the conversion to `rgb()` would not make sense. Should it apply before or after the conversion to `rgb()`? Should it only apply when it is not mixed with another color?

Whiteness/blackness was clipped:

  - at parse time before https://github.com/w3c/csswg-drafts/commit/97d0f58ba5600a61ba454c51038925237110c6af
  - at computed-value time before https://github.com/w3c/csswg-drafts/commit/52c454f05c8061923bd5bdb6bf5814a16ad7a0ed

Note: I asked a similar [question](https://github.com/w3c/csswg-drafts/issues/9222#issuecomment-2127066306) for saturation > 100 in `hwb()` but the issue is closed.

Please view or discuss this issue at https://github.com/w3c/csswg-drafts/issues/10368 using your GitHub account


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

Received on Friday, 24 May 2024 19:53:17 UTC