Open ghost opened 12 years ago
issues have now been created at https://github.com/mapnik/carto-parser/issues, so cool to file them from there now.
btw, I think the proper solution for this will be for mapnik internally to use an expression type for colors. See the expressions label for some related ideas: https://github.com/mapnik/mapnik/issues?labels=expressions
@rfw @springmeyer Just added the functionality to handle this. I haven't kept up-to-date on what has changed with the branch on the mapnik page and if things are now severely out of sync. We should obviously merge everything and get things more organized.
It is an easy change, but we should also come to an exact definition on how the operators should work since it wasn't clear if we should be touching the alpha channel or not or if we should allow silly things like multiplying two colors together.
The following fails:
Since
#fff
gets turned into autree
node, multiplication by0.7
is not possible incarto::expression::eval_node
as it directly tries to multiply autree
with adouble
.The only way I can see around this is to create a new data structure for colors that overloads arithmetic operations, but it may require an overhaul of internals.