ColoringFragment
Functions to generate coloring from the pixel values. Describes how to read the data value from the input files and transform the values to colors.
GradientColoringFragment
Use color gradient to generate coloring from the pixel values.
Example
Constructor
Parameters
Options to provide to the Layer constructor
(GradientColoringFragmentOptions)
options.decode | Describes how to read the data value from the input files. |
---|---|
options.stops
default:
[
{ value: decode.min, color: [0, 0, 0, 0] },
{ value: decode.max, color: [255, 255, 255, 255] },
] |
The color stops of the gradient |
options.smooth
default: true
|
Apply the gradient smoothly, rather then discrete steps. |
options.opacity
default: 1
|
Opacity of the gradient in [0, 1] |
OpacityColoringFragment
Use a single color, only change opacity based on the decoded value.
Example
Constructor
Parameters
Options to provide to the Layer constructor
(OpacityColoringFragmentOptions)
options.decode | Describes how to read the data value from the input files. |
---|---|
options.color
RgbaColor
default:
[255, 255, 255] |
RGB[A] - Array of 3-4 numbers. 0-255 per channel. |
options.opacity
default: 1
|
Opacity of the gradient in [0, 1] |
MultiChannelGradientColoringFragment
Interpret image channels in the context of a multi channel gradient coloring fragment.
Example
Constructor
Parameters
Options to provide to the Layer constructor
(MultiChannelGradientColoringFragmentOptions)
options.decode
default:
{
polynomialCoefDegree2: 0,
polynomialCoefDegree1: 1,
polynomialConstant: 0,
} |
Polynomial information as per how to decode the multi channel value. The default polynomial is f(x) = 0x^2 + 1x + 0, or put simply: f(x) = x , so no transformation is applied to the data. |
---|---|
options.stopsPerCategory
default:
[
{
category: "all",
stops: [
{ value: 0, color: [0, 0, 0] },
{ value: 255, color: [255, 255, 255] },
],
},
] |
The color stops for each gradient. There is a gradient per category. |
options.smooth
default: true
|
Apply the gradient smoothly, rather then discrete steps. |
options.opacity
default: 1
|
Opacity of the gradient in [0, 1] |