Color utilities.
More...
|
| template<typename T1 , typename T2 > |
| void | Euclid::colormap (const igl::ColorMapType &cm, const std::vector< T1 > &values, std::vector< T2 > &colors, bool to255=false, bool alpha=false, bool inverse=false) |
| | Color map. More...
|
| |
| template<typename T > |
| void | Euclid::rnd_colors (unsigned n, std::vector< T > &colors, bool to255=false, bool alpha=false) |
| | Generate a set of random colors. More...
|
| |
This package provides tools to help with colors in visualisation.
template<typename T1 , typename T2 >
| void Euclid::colormap |
( |
const igl::ColorMapType & |
cm, |
|
|
const std::vector< T1 > & |
values, |
|
|
std::vector< T2 > & |
colors, |
|
|
bool |
to255 = false, |
|
|
bool |
alpha = false, |
|
|
bool |
inverse = false |
|
) |
| |
Map values to colors.
- Parameters
-
| cm | Color map type. |
| values | Input values. |
| colors | Output colors |
| to255 | Set to true if you want to output colors to range [0, 255], default to range [0, 1]. |
| alpha | Set to true if you want to generate rgba colors instead of rgb. The alpha value is set to totally opaque. |
| inverse | Set to true if you want to invert the color map so that the smallest value is mapped to the color corresponding to the largest one and vice versa. |
template<typename T >
| void Euclid::rnd_colors |
( |
unsigned |
n, |
|
|
std::vector< T > & |
colors, |
|
|
bool |
to255 = false, |
|
|
bool |
alpha = false |
|
) |
| |
- Parameters
-
| n | Number of colors to generate. |
| colors | Output colors. |
| to255 | Set to true if you want to output colors to range [0, 255], default to range [0, 1]. |
| alpha | Set to true if you want to generate rgba colors instead of rgb. The alpha value is set to totally opaque. |