mapbox / carto

fast CSS-like map stylesheets
https://cartocss.readthedocs.io/
Apache License 2.0
652 stars 129 forks source link

v0.16.x regression in color math #443

Closed springmeyer closed 8 years ago

springmeyer commented 8 years ago
@water: #a0c8f0;

#water {
  polygon-fill: @water - #111;
}

This gives #8fb7df in carto v0.15.x and #838383 in carto v0.16.x

springmeyer commented 8 years ago

/cc @nebulon42 - any idea what might have caused this change?

nebulon42 commented 8 years ago

Yes, there were two things: First, it was possible that the hue value was NaN for greyscale colours, which led to unexpected results in the math operation. Second, math operations on colours have to be done in RGB for backwards compatibility.

Fixed now.

pnorman commented 8 years ago

fwiw, I'm not sure that subtracting one color from another and rendering the result makes sense. When you subtract colours you get a colour difference, which you could then add to another colour. The semantics of this are similar to datetimes and intervals

springmeyer commented 8 years ago

Great work, thank you @nebulon42! Just published v0.16.2.