[name]

Represents a lookup table for colormaps. It is used to determine the color values from a range of data values.

Example

var lut = new THREE.Lut( "rainbow", 512 ); var data = [0, 10.1, 4.2, 3.4, 63, 28]; lut.setMax(63); color = lut.getColor(10);

Constructor

[name]( colormap, numberOfColors )

colormap - optional argument that sets a colormap from prefefined colormaps. Available colormaps are : "rainbow", "cooltowarm", "blackbody". numberOfColors - optional argument that sets the number of colors used to represent the data array.

Properties

.[page:Float minV]

The minimum value to be represented with the lookup table. Default is 0.

.[page:Float maxV]

The maximum value to be represented with the lookup table. Default is 1.

Methods

.copy( [page:Lut lut] ) [page:Lut this]

color — Lut to copy.
Copies given lut.

.setminV( [page:Float minV] ) [page:Lut this]

minV — The minimum value to be represented with the lookup table.
Sets this Lut with the minimum value to be represented.

.setmaxV( [page:Float maxV] ) [page:Lut this]

maxV — The maximum value to be represented with the lookup table.
Sets this Lut with the maximum value to be represented.

.changeNumberOfColors( [page:Float numberOfColors] ) [page:Lut this]

numberOfColors — The number of colors to be used to represent the data array.
Sets this Lut with the number of colors to be used.

.changeColorMap( [page:Float colorMap] ) [page:Lut this]

colorMap — The name of the color map to be used to represent the data array.
Sets this Lut with the colormap to be used.

.addColorMap( colorMapName, arrayOfColors ) [page:Lut this]

Insert a new color map into the set of available color maps.

.getColor( value ) [page:Lut this]

value -- the data value to be displayed as a color.
Returns a Three.Color.

Source

[link:https://github.com/mrdoob/three.js/blob/master/examples/js/math/[path].js examples/js/math/[path].js]