Home > @i2analyze/notebook-sdk > visual > IBrushColorRange > getColor
visual.IBrushColorRange.getColor() method
Returns the CSS color string for the given brush index.
Signature:
getColor(index: BrushIndex): string;
Introduced: version 1.9
Parameters
| Parameter | Type | Description |
|---|---|---|
| index | BrushIndex | The brush index to get the color for. |
Returns:
string
A CSS color string (for example, '#FF0000', 'rgb(255, 0, 0)', 'red').
Remarks
The behavior of this method depends on the implementation. For color ranges created with app.IValueFactory.createBrushColorRange, if the index matches a key exactly, the corresponding color is returned; if it falls between two keys, the color is interpolated linearly between the colors of the two nearest keys; and if it is outside the range of defined keys, an Error is thrown.