Assigning color-gradient to value-sectrum an different shape-polygons?

christ.stark's Avatar

christ.stark

29 Sep, 2011 08:09 PM

Hi,

I would like to create a map of different countries and each of these countries is supposed to represent a value. Let's say from 10 to 100. Now I want to assign the color dark-blue to the polygon/country that represents the value 10 and white to the country that represents the value 100.
All countries with values in between 10 and 100 I would like Tilemill to give a color automatically according to the value.

Is this possible?

best regards
desputin

  1. Support Staff 2 Posted by AJ on 30 Sep, 2011 02:56 PM

    AJ's Avatar

    Hi,

    Currently there's no built-in way to do color interpolation like this. It is partly a limitation of the underlying renderer which requires discrete values for feature filters.

    You could write a small script that iterates over all of the values between 10 and 100 and generates discrete rules for each. Color gradients could be made by gradually adjusting arguments to carto color functions, eg this pattern will work its way from dark blue to light green:

    lighten(spin(@darkblue, -1) 1%);
    lighten(spin(@darkblue, -2) 2%);
    lighten(spin(@darkblue, -3) 3%);
    ...
    
  2. Will White closed this discussion on 24 Oct, 2011 03:46 PM.

Comments are currently closed for this discussion. You can start a new one.

Recent Discussions

25 May, 2013 09:12 AM
25 May, 2013 08:30 AM
25 May, 2013 01:00 AM
25 May, 2013 12:58 AM
25 May, 2013 12:20 AM