An array containing {level, color} entries (object literals).
Levels are treated as Number
s. Colors are RIA Color
s.
The first element is a level. Entries are expected to be sorted in ascending level order.
var gradientColorMap = ColorMap.createGradientColorMap([
{level: 100, color: "rgba(0, 0, 0, 1.0)"}, //100 -> Black
{level: 200, color: "rgba(0, 255, 0, 1.0)"}, //200 -> Green
{level: 300, color: "rgba(0, 0, 255, 1.0)"} //300 -> Blue
]);
Create a piecewise constant color map. Unlike a gradient color map, no colors are interpolated in a piecewise constant map.
The example shows a ColorMap with 3 levels and 2 colors. The levels are mapped to colors as follows (level -> color):
An array with alternating level, color values in it.
Levels should be Number
s. Colors are represented as RIA Color
s.
The first element is a level. Elements are expected to be sorted in ascending level order.
var piecewiseConstantColorMap = ColorMap.createPiecewiseConstantColorMap(
[100, "rgba(0, 0, 0, 1.0)", 200, "rgba(0, 255, 0, 1.0)", 300]);
Create a gradient color map. Colors corresponding to levels in the level range of the color map are linearly interpolated (including alpha) between entries.
The example shows a ColorMap with 3 levels and 3 colors. The levels are mapped to colors as follows (level -> color):