Re: [csswg-drafts] [css-color-4] Missing info about Premultiplication and Undefined values (#7536)

> I wonder if it would be better to go back to just handling achromatic colors specially in the interpolation algorithm rather than have undefined components, even though undefined components is a more elegant solution... I mean, an achromatic color is still an achromatic color when converted to another color spaceā€¦

I'd personally hate the pendulum to swing too far in either direction. The heart of the issue had nothing to do with the current discussion. Really, I just thought it would be important to make clear that when two colors are being interpolated that premultiplication needs to come after an undefined resolution.

From the very beginning, it was understood that when a color with undefined components is converted that undefined values would need to be resolved, and it was decided that undefined channels would become zero. The spec already states this. This comes with certain implications that I thought were well understood.

Because `none` was introduced, some users could exploit this behavior and set channels to undefined values to try and take advantage of the logic, but as long as the spec makes clear what would happen in these cases, I think that is fine. I don't the solution needs to be more magic or reverted.

I think the current behavior is fairly intuitive. Yes, I'm sure even if spelled out completely, some people may still be surprised at first, but that is true for a lot of things. If needed, I think it could be mentioned that if you are going to set `none` manually to channels in order to exploit its behavior during interpolation, undefined values will not persist through conversion unless the channel's undefined behavior is dictated by its achromatic nature. If you want the manual insertion of  `none` to be meaningful, you need to work in the same color space, if not, they will be assigned a defined value of `0`.

I think going back to only handling achromatic is the lesser of the two evils, but I'm not sure I prefer that over just adding a few more comments to make clear what should happen during premultiplication and will happen if you try to exploit `none` during interpolation.


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


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

Received on Sunday, 31 July 2022 13:23:14 UTC