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

Thomas Davie tom.davie at gmail.com
Mon Feb 7 09:16:15 GMT 2011

On 7 Feb 2011, at 09:12, Thomas Davie wrote:

> The css mailing list recently had a long discussion about hex codes and names being a really ugly way of dealing with colours, and arguing that they should be dropped in favour of rgb(r,g,b) and rgba(r,g,b,a) (along with potentially other colour spaces for print for example).  The conclusion was that there's a lot of legacy css out there that this would break, and a lot of html/css editors that would continue to produce broken code.  Because of this, they never changed the standard.  We have a far smaller problem here – our existing stylesheet base is much smaller, and hence perhaps have the chance to nip the problem in the bud now.
> I propose that all colour specifications be replaced with the modern specifiers.
> I also have a second proposal related to this.  CSS typically uses the range 0 to 255 even in these specifiers.  I'd like to propose that we use the cleaner 0.0 to 1.0 range.  This has the advantage of not exposing an implementation detail, though I acknowledge there's a disadvantage in deviating from what css does here.

Appologies for following up my own mail.

One further advantage of this proposal is that it cleans up the use of opacity: all over the place.  If users want non-opaque items, they can simply use an rgba colour.  If the colour is specified to multiply any image specified, then semi-transparent (or even colour variant) images are easily supported too.

The use of 0.0 to 1.0 appears to be consistent with the existing semantics of opacity: properties.


Tom 'Beelsebob' Davie

More information about the Mapcss mailing list