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

Re: [css-color] Alpha component of "color" property and color glyphs

From: Tab Atkins Jr. <jackalmage@gmail.com>
Date: Thu, 31 Mar 2016 10:52:29 -0700
Message-ID: <CAAWBYDB6oZKLWiw+kHeB1_eFf14Ra7W5JZnZfqOMe7=ck7=YQA@mail.gmail.com>
To: Xidorn Quan <quanxunzhen@gmail.com>
Cc: www-style list <www-style@w3.org>, Jonathan Kew <jfkthame@gmail.com>, cku@mozilla.com
On Wed, Mar 30, 2016 at 10:04 PM, Xidorn Quan <quanxunzhen@gmail.com> wrote:
> Hi,
>
> There is a question that, should the alpha component of "color" property
> affect color glyphs like other normal glyphs? Our opinion is, it should not.
>
> Currently, in WebKit and Edge, alpha of "color" doesn't affect color glyphs,
> which means even if you specify "color: transparent", you can still see
> color glyphs. In Blink, the alpha of "color" decides the opacity of color
> glyphs like other glyphs. In Gecko 45, the behavior is mostly like WebKit
> and Edge, but color glyphs disappear when color is totally transparent, due
> to a misoptimization. However, since Gecko 46, the behavior is changed to
> Blink's.
>
> The spec says, "color" is "the foreground fill color of ... text content".
> It seems to me it also means alpha component, just like other components,
> should not affect color glyphs, since those glyphs do not use fill color at
> all.
>
> It would also affect "background-clip: text", as people generally use
> "color: transparent" (or actually "-webkit-text-fill-color: transparent") to
> hide the text. However, hiding color glyphs and leaving the outline there
> like normal glyphs doens't make much sense. Most emojis would end up being
> just a circle in that case, which completely loses their original meaning.
>
> If authors want to make a piece of text, including color glyphs,
> translucent, opacity is always the right property to use.
>
> Given these, we think WebKit and Edge's behavior, which also matches the
> spec, is most sensible, and we are going to switch to that behavior as well.
>
> I think given it is not fully interoperable at the moment, and authors may
> have contrary expectation intuitively, this is at least worth a note in the
> spec saying something like, "color property, including its alpha component,
> does not affect glyphs which do not use fill color (e.g. color glyphs).
> Authors are suggested to use opacity if they want to make them translucent
> as well."
>
> Thoughts?

Assuming we end up adding a switch to dictate whether you want the
"glyph" or "picture" version of emoji, I agree with you - the alpha of
the fill color shouldn't apply to the "picture" glyphs, since they
aren't using the fill color at all.

~TJ
Received on Thursday, 31 March 2016 17:53:16 UTC

This archive was generated by hypermail 2.4.0 : Friday, 25 March 2022 10:09:01 UTC