[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.
.[legend]
The legend of the lookup table.
Methods
.copy( [page:Lut lut] ) [page: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.
.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]