[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 predefined colormaps. Available colormaps are : "rainbow", "cooltowarm", "blackbody". numberOfColors - optional argument that sets the number of colors used to represent the data array.

Properties

[property:Float minV]

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

[property:Float maxV]

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

.[legend]

The legend of the lookup table.

Methods

[method:null copy]( [param:Lut lut] ) [param:Lut this]

color — Lut to copy.

Copies given lut.

.setLegendOn [parameters]

parameters - { layout: value, position: { x: value, y: value, z: value }, dimensions: { width: value, height: value } } layout — Horizontal or vertical layout. Default is vertical.
position — The position x,y,z of the legend.
dimensions — The dimensions (width and height) of the legend.

Sets this Lut with the legend on.

.setLegendOff

Sets this Lut with the legend off.

.setLegendLabels [parameters, callback]

parameters - { fontsize: value, fontface: value, title: value, um: value, ticks: value, decimal: value, notation: value } fontsize — Font size to be used for labels.
fontface — Font type to be used for labels.
title — The title of the legend.
um — The unit of measurements of the legend.
ticks — The number of ticks to be displayed.
decimal — The number of decimals to be used for legend values.
notation — Legend notation: standard (default) or scientific.
callback — An optional callback to be used to format the legend labels.

Sets the labels of the legend of this Lut.

[method:Lut setMin]( [param:Float minV] )

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

Sets this Lut with the minimum value to be represented.

[method:Lut setMax]( [param:Float maxV] )

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

Sets this Lut with the maximum value to be represented.

[method:Lut changeNumberOfColors]( [param:Float numberOfColors] )

numberOfColors — The number of colors to be used to represent the data array.

Sets this Lut with the number of colors to be used.

[method:Lut changeColorMap]( [param:Float colorMap] )

colorMap — The name of the color map to be used to represent the data array.

Sets this Lut with the colormap to be used.

[method:Lut addColorMap]( colorMapName, arrayOfColors )

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

[method:Lut getColor]( value ) [param:Lut this]

value -- the data value to be displayed as a color.

Returns a [page:Color].

Source

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