W3C home > Mailing lists > Public > whatwg@whatwg.org > June 2015

Re: [whatwg] Icon mask and theme color

From: Smylers <Smylers@stripey.com>
Date: Wed, 17 Jun 2015 07:51:43 +0100
To: whatwg@lists.whatwg.org
Message-ID: <20150617065143.GF2720@stripey.com>
Maciej Stachowiak writes:

> > On Jun 16, 2015, at 4:37 AM, Nils Dagsson Moskopp
> > <nils@dieweltistgarnichtso.net> wrote:
> > 
> > (5) Use the shape of the path in the SVG icon as a mask and retain
> > the theme color meta value. Why isn't this done? One could have a
> > properly colored icon for one purpose and use the outline of the
> > same icon for the flat design staff.
> We could change to considering only the alpha channel of the mask icon
> instead of both mask and luminance. ... Note though, that even if we
> went alpha-only, it might not be possible to use the same file for a
> mask icon and a full-color icon and get good results, for certain
> effects.

Sure — for the best results a site may want separate icons. But the
recent threads have been largely prompted by sites inadvertently serving
suboptimal icons, so we also need to consider the behaviour when they
make a mistake, not just the ideal case.

And even for the ideal case, a single icon may suffice for some sites.
Twitter, for example, with a solid blue bird shape as the colour icon,
which could also work as a mask. That _some_ sites would require two
icons doesn't seem like a reason to impose that burden on _all_ sites.

> obvious example is Facebook’s normal favicon, which is a white
> lowercase f on a blue rounded rectangle. It’s important in the color
> version for the white to be white, not transparent, but if both the
> white and blue are solid, the mask version is just a roundrect.

Yep, the ideal colour version wouldn't work as a mask. But t'other way
round, the mask could work as an acceptable (albeit not ideal) colour
icon. Currently when the mask is inadvertently used as the ‘colour’
icon, it has to be all black. But with Nils's suggested change above,
the mask could use Facebook blue instead of black; the masking effect
would be the same, but if the mask ends up being interpreted as as a
colour icon, it then at least has some colour in it.

> > On Jun 15, 2015, at 12:53 PM, Kornel Lesiński <kornel@geekhood.net>
> > wrote:
> > 
> > (4) Don't require the mask icon to be 100% black and read the color
> > from the icon itself. 
> > 
> > The mask flag would indicate that shape of the icon is distinctive
> > enough, i.e. alpha channel of the icon can be used without the color
> > channels, but wouldn't forbid use of color channels.
> > 
> > If in Safari you'd like to enforce use of only a single solid theme
> > color for the icon, then you can compute the theme color by
> > averaging colors of all non-transparent pixels of the mask icon, and
> > use that as the icon's theme color.
> We do have a requirement to have the mask icons render with a single
> color. I don’t think the approach suggested here is very good. Color
> averaging would not be very predictable in its results and could be
> unstable to changes in the icon if it’s actually multi-color.

No, but colour-averaging would only be a fallback to get _some_ colour
in the situation where the developer failed to follow guidelines and put
multiple colours in their mask image.

Again, consider Twitter: if they have an icon which already is a solid
shape of the correct colour (so it can be used as a colour icon, too),
why should they have to specify that colour a second time in their HTML?
You already know what the colour is, from the icon itself.

Received on Wednesday, 17 June 2015 06:52:10 UTC

This archive was generated by hypermail 2.4.0 : Wednesday, 22 January 2020 17:00:33 UTC