Home > @i2analyze/notebook-sdk > app > IValueFactory > createBrushColorRange
app.IValueFactory.createBrushColorRange() method
Creates a color range from a configuration that maps brush indices to CSS color strings.
Signature:
createBrushColorRange(config: visual.ColorRangeConfig): visual.IBrushColorRange;
Introduced: version 1.9
Parameters
| Parameter | Type | Description |
|---|---|---|
| config | visual.ColorRangeConfig | A mapping of brush indices to CSS color strings. |
Returns:
A new color range.
Exceptions
Error if the configuration is empty or contains invalid color strings.
Remarks
The returned color range resolves colors for any index within the range of the provided keys. If an index matches a key exactly, its color is returned directly. If an index falls between two keys, the color is interpolated linearly between the colors of the two nearest keys.
This supports both discrete and continuous (gradient) color ranges, depending on the configuration you provide. See visual.ColorRangeConfig for details.