Color map¶
This page contains classes defined in hakowan.common.colormap
module.
ColorMap
¶
A color map is a function that linearly interpolate a set of color samples.
Source code in hakowan/common/colormap/colormap.py
__init__(samples)
¶
Construct color map from color samples.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
samples |
NDArray
|
A numpy array of shape (n, 3). Each row is a color sample. |
required |
Source code in hakowan/common/colormap/colormap.py
__call__(value)
¶
Evaluate color map at a value between 0 and 1.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
value |
float
|
A value between 0 and 1. |
required |
Returns:
Type | Description |
---|---|
Color
|
The interpolated color. |
Source code in hakowan/common/colormap/colormap.py
num_colors()
¶
Number of color samples stored in this color map.
Returns:
Type | Description |
---|---|
int
|
Number of colors in the color map. |