Construct a LUT object, specifying any amount of its properties.
Example 1, LUT with interpolation disabled.
const lut = new LUT({
steps: [
{ value: 0, color: ColorRGBA( 0, 0, 0 ) },
{ value: 10, color: ColorRGBA( 255, 0, 0 ) },
{ value: 100, color: ColorRGBA( 0, 255, 0 ) }
],
interpolate: false
})
Example 2, LUT with interpolation enabled.
const lut = new LUT({
steps: [
{ value: 0, color: ColorRGBA( 0, 0, 0 ) },
{ value: 10, color: ColorRGBA( 255, 0, 0 ) },
{ value: 100, color: ColorRGBA( 0, 255, 0 ) }
],
interpolate: true
})
Readonly colorFallback color, which is used if LUT steps are defined as empty or defined incorrectly.
Default value: Black.
Readonly interpolateInterpolation behavior of the LUT, which describes the distribution of color for the data:
Default value: true.
Readonly isValidation flag which describes that the LUT is configured correctly.
Readonly lengthAmount of LUT steps.
Readonly maxMaximal value of the entire LUT.
Readonly minMinimal value of the entire LUT.
Readonly stepsThe collection of LUTSteps, which specifies the colors and their corresponding values to describe the location and color of a transition point in a gradient. Each represented as a pair object {value: number, color: Color}.
Default value: [].
Readonly subrangesCollection of subranges.
Readonly titleTitle of the LUT, which describes the visualization.
Default value: Empty string.
Readonly unitsUnits of the data-values in the LUT, which describes the data domain.
Default value: Empty string.
Get the color associated with the given value.
Example:
const color = lut.getColors( 5 )
Associated color if the LUT is valid, otherwise fallback color.
Single value.
Get the colors associated with the given collection of values.
Example:
const colors = lut.getColors( [ 5, 10, 15 ] )
Collection of associated colors if the LUT is valid, otherwise fallback colors.
1D collection of value.
Get the colors associated with the given collection Matrix2D of values.
Example:
const colors = lut.getColors(
[
[ 3, 7, 9 ],
[ 5, 10, 15 ]
]
)
Collection of associated colors if the LUT is valid, otherwise fallback colors.
2D collection of values.
Set interpolation behavior of the LUT, which describes the distribution of color for the data:
Interpolation behavior: True - gradient, False - uniform.
Style class for describing a table of colors with associated lookup values (numbers).
Instances of LUT, like all LCJS style classes, are immutable, meaning that its setters don't modify the actual object, but instead return a completely new modified object.
Properties of LUT:
steps: List of color steps (color + number value pair).interpolate:trueenables automatic linear interpolation between color steps.LUT Behavior:
Example 1, LUT with interpolation disabled.
Example 2, LUT with interpolation enabled.
LUT Usage:
Use LUT with: