[Mapcss] Proposal: Drop css's ugly colour specifications

Thomas Davie tom.davie at gmail.com
Mon Feb 7 17:27:57 GMT 2011

On 7 Feb 2011, at 17:18, Komяpa wrote:

> Hi,
> 2011/2/7 Thomas Davie <tom.davie at gmail.com>:
>> This all seems to be rather a cludge around a simple dilema – sometimes you want to multiply colours, sometimes you want to replace colours.
>> Your opacity replacement there is really a case of "multiply the opacity of the colour by 0.2", and can be generalised to "multiply the colour by rgba(1.0, 1.0, 1.0, 0.2)"
>> Is what's really needed a colour-multiply: property instead of opacity (but as well as a colour:) property?
> Looks for me as useless hackish thing - there are lot of other better
> things to do.
> Now MapCSS is rather easy to understand for non-programmers. HTML/CSS
> is studied at schools, so people know what id #rrggbb.
> Thousands of programs support #rrggbb notation, and lots of people
> (including me) can rather easily imagine color by that notation. If
> you'll leave me only something like rgb(0.22, 0.12e1, 1.2), my head
> will blow up reading/writing that, and I'll _have_ to introduce
> #rrggbb notation back in some way.
> The color-multiply looks like operation, and, may be, should be done
> inside eval(). But first I'd like to see real-world examples of such
> stylesheets :)

Real world example:

    icon-image: url("whiteParkingIcon.png");
    color-multiply: rgb(0.2, 0.2, 1.0); /* using 0-1 for the moment */

    color-multiply: rgb(1.0, 0.2, 0.2);

    color-multiply: rgba(0.2, 0.2, 1.0, 0.6);

I can see your argument for wanting to do it within an eval, that would allow for more interesting compositing operations too – but do we have an existing way to get at style properties that have been set on an element in an eval expression?  I thought we only had a way to get at tags that were set.


Tom Davie

More information about the Mapcss mailing list