Re: [csswg-drafts] [css-color-4] Are a and b in lab( 0%, a, b ) really powerless? [css-color-4] (#6758)

Powerless components becoming zero is an incidental effect; it's not meant to mean anything, they just become *missing* in certain circumstances (such as color space conversions) and we need to render *something* for missing components if such a color is rendered directly (which is an error on the author's part). Substituting in a zero is just the most obvious "default value" to sub in for this, and since this is an error case in the first place, it doesn't really matter what we choose.  If that ends up becoming convenient for implementations for some reason, great, but it's not the point.

The point of powerless/missing components is to give good transition/animation behavior, so authors don't have to provide dummy values for the components that don't affect the starting color, and instead they get the most obvious "correct" behavior by default of taking the missing component from the other side, similar to what premultiplied alpha provides for rectangular coordinate systems.

Without this behavior, animating from `lch(50% 50 180deg)` to `black` would give frustrating results: `black` would (correctly) convert into `lch(0% 0 0deg)`, then the animation would show a greenish color darkening (expected, good), desaturating (may or may not be expected), and wildly swinging hue around to red (*definitely* not expected, very bad); to work around it authors would have to manually create a "green black" like `lch(0% 0 180deg)`. This was the case in sRGB before we specified premultiplied alpha, too; authors would have to create a "correctly-colored transparent" to have a good gradient or animation that didn't go grayish as the color faded.

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


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

Received on Tuesday, 26 October 2021 00:25:54 UTC