|
| Color () |
| Default constructor.
|
|
| Color (const std::array< float, 3 > &xyz, Model m_=Model::RGB) |
| Constructor from an array of 3 floats.
|
|
| Color (const std::array< float, 4 > &xyza, Model m_=Model::RGB) |
| Constructor from an array of 4 floats.
|
|
| Color (const std::initializer_list< float > xyza, Model m_=Model::RGB) |
| Constructor from an initializer list of floats.
|
|
| Color (const std::string &hex_str) |
| Constructor from a hex string.
|
|
const Model & | model () const |
| Getter for the color model.
|
|
std::string | hex_str () const |
| Converts the color to a hex string in html format.
|
|
codac2::Vector | vec () const |
| Converts the color to a codac2::Vector.
|
|
Color | rgb () const |
| Converts the color to RGB format.
|
|
Color | hsv () const |
| Converts the color to HSV format.
|
|
Color structure, in RGBA or HSVA format.
This class is used to represent a Color, either in RGBA or HSVA format. It inherits from std::array<float,4> and provides methods to convert between different color models.
For RGBA, the values are in the range [0,255].
For HSVA, the values are in the range [0,360] for hue and [0,100] for saturation, value and alpha.
Predefined Colors are also available.