W3C home > Mailing lists > Public > public-css-archive@w3.org > September 2020

Re: [csswg-drafts] [css-color-5] [css-values-4] Interpolation and mixing of colors (#5392)

From: Chris Lilley via GitHub <sysbot+gh@w3.org>
Date: Fri, 18 Sep 2020 14:24:43 +0000
To: public-css-archive@w3.org
Message-ID: <issue_comment.created-694899633-1600439081-sysbot+gh@w3.org>
In V&U [8.1.1. Combination of &lt;color>](https://drafts.csswg.org/css-values-4/#combine-colors)

> Interpolation of &lt;color> is defined as the independent interpolation of each component (red, green, blue, alpha) as a &lt;number>. Interpolation is done between premultiplied colors (that is, colors for which the red, green, and blue components specified have been multiplied by the alpha).

This has a number of problems:

1. It assumes additivity, but operations are performed on a non-additive (gamma corrected) component. As is well known, this gives substantial error. But it is also how the Web currently works, so any better solution needs to be opt-in.
2. It assumes an orthogonal, rectangular coordinate system - which RGB is, but polar forms such as HSL HWB LCH are not. Clearly you don't multiply an alpha of 50% with a hue angle of 120deg to get 60deg, for example.
3. It assumes sRGB only. The section on Color interpolation does not.

So I'm looking for improved wording for the alpha premultiplication step which is color-space agnostic, ideally has an opt-in to linear-light computation (un-gamma-corrected RGB, or equivalently CIE XYZ to handle multiple spaces) which can be added to CSS Color 5 Interpolation section.

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

Sent via github-notify-ml as configured in https://github.com/w3c/github-notify-ml-config
Received on Friday, 18 September 2020 14:24:45 UTC

This archive was generated by hypermail 2.4.0 : Tuesday, 5 July 2022 06:42:16 UTC