artemp/trac2github — Issue #512: Change in alpha value in Mapnik color constructor between Mapnik 0.7 and 0.8
Author: artemp
Created: 2011-10-09 20:38:14+00:00
State: open
Labels: Core_Library

Is this an intended change? Previously the alpha input was interpreted as a fraction:

0.7:
{{{
>>> mapnik.mapnik_version()
700
>>> c = mapnik.Color('rgba(235,217,194,20)')
>>> c.a
255
>>> c = mapnik.Color('rgba(235,217,194,.5)')
>>> c.a
128

}}}

trunk:
{{{
>>> mapnik.mapnik_version()
800
>>> c = mapnik.Color('rgba(235,217,194,.5)')
Traceback (most recent call last):
File "", line 1, in
RuntimeError: Failed to parse color value: Expected a color, but got 'rgba(235,217,194,.5)'
>>> c = mapnik.Color('rgba(235,217,194,128)')
>>> c.a
128
]}}