Creates a ColorMap by specifying a single ColorMapObject or multiple ones as an array.
If omitted, it behaves as if {min: 0, max: 255, colors: ["000000", "ffffff"]} was specified.
Returns the ColorMapObject given as the argument of the constructor.
Returns the color at the value x as an object {r(red component), g(green component), b(blue component), a(alpha component)}. Each component has a value from 0 to 255.
Returns the color at the value x as a Uint8ClampedArray. The Uint8ClampedArray is an array of [R(red component), G(green component), B(blue component), A(alpha component)], and each component has a value from 0 to 255.
Returns the legend image of this ColorMap as a PNG image Uint8Array.
The width of the image (in pixels).
The height of the image (in pixels).
Returns the legend image of this ColorMap as an ImageDataObject.
The width of the image (in pixels).
The height of the image (in pixels).
Returns the legend image of this ColorMap (with scale values and unit text annotated) as an HTMLCanvasElement.
The width of the entire image including scales and units (in pixels).
The height of the entire image including scales and units (in pixels).
The size of the text.
The unit text to annotate within the legend image.
Creates a color map for visualization.
Example