Euclid
Geometry Processing and Shape Analysis in C++
Color

Color utilities. More...

Functions

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...
 

Detailed Description

This package provides tools to help with colors in visualisation.

Function Documentation

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
cmColor map type.
valuesInput values.
colorsOutput colors
to255Set to true if you want to output colors to range [0, 255], default to range [0, 1].
alphaSet to true if you want to generate rgba colors instead of rgb. The alpha value is set to totally opaque.
inverseSet 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
nNumber of colors to generate.
colorsOutput colors.
to255Set to true if you want to output colors to range [0, 255], default to range [0, 1].
alphaSet to true if you want to generate rgba colors instead of rgb. The alpha value is set to totally opaque.