W3C home > Mailing lists > Public > www-style@w3.org > January 2016

Re: [css-images] Negative implications of linear gradient color space choice in CSS

From: Rik Cabanier <cabanier@gmail.com>
Date: Sun, 24 Jan 2016 23:22:44 -0800
Message-ID: <CAGN7qDAPLTENWi-dZPeNeUkTG7P2dkNVj2E0nw2zHazGPf6aLQ@mail.gmail.com>
To: Simon Fraser <smfr@me.com>
Cc: Mark Straver <mark@wolfbeast.com>, www-style list <www-style@w3.org>
On Sun, Jan 24, 2016 at 10:25 PM, Simon Fraser <smfr@me.com> wrote:

> On Jan 23, 2016, at 9:37 pm, Rik Cabanier <cabanier@gmail.com> wrote:
> On Sat, Jan 23, 2016 at 10:23 AM, Simon Fraser <smfr@me.com> wrote:
>> This has been discussed several times in the past; we all agree that
>> interpolating in non-premultiplied colors
>> is better, but this is not supported by the graphics frameworks on some
>> platforms (e.g. by CoreGraphics on Mac)
>> so the spec is not able to mandate it.
> You have it reversed. The graphics frameworks in the browsers all
> interpolate in non-premultiplied data. I had to add emulation code to all
> the browsers to make this happen.
> Are you sure?

Yes, I am sure. Although it looks like I forgot to add the emulation code
to Safari
If you open this in Safari:  https://jsfiddle.net/2ff05z2y/ you will see
that the gradient is not in premultiplied space.

> Gradients with a transparent endpoint in Safari look grayish near the end,
> because alpha premultiplication has caused loss most of the RGB
> information. We need to interpolate with non-premultpliied alpha to be able
> to interpolate the color components and the alpha independently.

Yes, they are gray-ish because the interpolate with transparent black.

Transitions should interpolate alpha and color indepently (unless you mean
straight opacity?)
Received on Monday, 25 January 2016 07:23:12 UTC

This archive was generated by hypermail 2.4.0 : Friday, 25 March 2022 10:08:59 UTC