Re: [whatwg] Icon mask and theme color

On Tue, Jun 16, 2015 at 11:51 PM, Smylers <Smylers@stripey.com> wrote:
> Maciej Stachowiak writes:
>> 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.

*If* we detect the color from the icon (which I don't think is a bad
idea), using dominant color or first color (as Maciej argued) does
seem better than color averaging.  Averaging seems like it would
rarely produce a reasonable color in any multi-color icon, as it won't
produce any of the actual brand colors (and "how to average" is an
open question; many answers, like the obvious naive RGB averaging,
give terrible results in lots of cases).  Dominant/first color would
at least give you one of the brand colors.

And for single-color icons, dominant/first gives the same results as
averaging, so it's fine there.

~TJ

Received on Wednesday, 17 June 2015 23:42:30 UTC