查找表([name])

表示颜色表的查找表,用于从一个数据值的范围中确定颜色值。

代码示例

var lut = new Lut( 'rainbow', 512 ); var color = lut.getColor( 0.5 );

构造函数

[name]( colormap, numberOfColors )

colormap - (可选)从预定义的颜色表中设置一个颜色表。可选值有:"rainbow"、 "cooltowarm"、 "blackbody"。 numberOfColors - (可选)设置用于表示数据数组的颜色数量。

属性

[property:Float minV]

查找表所表示的最小值,默认为0。

[property:Float maxV]

查找表所表示的最小值,默认为1。

.[legend]

查找表的图例。

方法

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

color — 要拷贝的 Lut。

拷贝给定的 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 — 查找表所表示的最小值。

将查找表要表示的最小值设为该值。

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

maxV — 查找表所表示的最小值。

将查找表要表示的最大值设为该值。

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

numberOfColors — 用于表示数据数组的颜色数量。

设置查找表中要使用的颜色的数量。

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

colorMap — 用于表示数据数组的颜色表名称。

设置查找表的颜色表为传入的颜色表。

[method:Lut addColorMap]( colorMapName, arrayOfColors )

插入一个新的颜色表到可用颜色表中。

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

value -- 作为颜色展示的数据值。

返回一个[page:Color]。

源码

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