CartoDB / mobile-carto-libs

Internal dependencies for CARTO Mobile SDK
BSD 3-Clause "New" or "Revised" License
4 stars 5 forks source link

color functions not working with variables or ternary operators #21

Closed farfromrefug closed 1 year ago

farfromrefug commented 2 years ago

If i do this :

line-color:desaturate([color], 30%);

it wont work this neither

line-color:desaturate([color] ? [color] : @biking_route_fill, 30%);

while this work

line-color:desaturate(@biking_route_fill, 30%);
mtehver commented 2 years ago

@farfromrefug Correct, most color functions are evaluated at preprocessing stage and thus need constant arguments. This is how MapBox Studio Classic and original CartoCSS translation works. There are no Mapnik equivalents for saturate, desaturate, darken etc functions. So this is could be implemented, but I am giving this a low priority right now.

farfromrefug commented 2 years ago

@mtehver sure thing. Just feels weird cause you tend to want to try it in css ;)

farfromrefug commented 1 year ago

@mtehver i confirm the issue was with duplicate variable declaration