Color maps - davidmegginson/hxlmaps GitHub Wiki

A Color map allows you to define a gradient of colours to display in a Choropleth layer on a hxlmap. A simple color map in the layer definition of a hxlmaps JSON configuration looks like this:

"colorMap": [
  [0.0, "#ffff00"],
  [1.0, "#ff0000"]
]

Each entry in the map consists of an array of two items: a numeric value, and a web hexadecimal color notation. The color map in this example will interpolate between yellow (#ffff00) for a value of 0.0 (0%) and red (#ff0000) for a value of 1.0 (100%).

You can also add multiple intermediate steps. For example, this map will interpolate between green (#00ff00) and yellow (#ffff00) from 0% to 50%, and then between yellow and red (#ff0000) from 50% to 100%:

"colorMap": [
  [0.0, "#00ff00"],
  [0.5, "#ffff00"],
  [1.0, "#ff0000"]
]

If you do not include a color map the definition of a choropleth layer, hxlmaps will default to a neutral blue gradient (light to dark).