template class EE::System::tColor¶
Overview¶
Template class for a RGBA color. More…
#include <color.hpp> template <typename T> class tColor { public: // fields Uint32 Value; T r; T g; T b; T a; T h; T s; T v; struct EE::System::tColor::@4::@8 hsv; T l; struct EE::System::tColor::@4::@9 hsl; // construction tColor(); tColor(T r, T g, T b, T a); tColor(const tRGB<T>& Col); tColor(const tRGB<T>& Col, T a); tColor(const tColor<T>& Col); tColor(const Uint32& Col); // methods Uint32 getValue() const; void assign(T r, T g, T b, T a); void assign(const tColor<T>& Col); bool operator==(const tColor<T>& Col) const; bool operator!=(const tColor<T>& Col) const; tColor<T> operator+(const tColor<T>& Col) const; tColor<T> operator-(const tColor<T>& Col) const; tColor<T> operator*(const tColor<T>& Col) const; tRGB<T> toRGB(); };
Detailed Documentation¶
Template class for a RGBA color.
Construction¶
tColor(T r, T g, T b, T a)
Creates an RGBA color from each component.
Parameters:
r |
Red component |
g |
Green component |
b |
Blue component |
a |
Alpha component |
tColor(const tRGB<T>& Col)
Creates a RGBA color from a RGB color, the Alpha component is set as non-transparent.
tColor(const tRGB<T>& Col, T a)
Creates a RGBA color from a RGB color.
Parameters:
Col |
The RGB color |
a |
The Alpha component value |
tColor(const Uint32& Col)
From a 32 bits value with RGBA byte order
Methods¶
Uint32 getValue() const
Returns:
The color represented as an Uint32 ( as 0xRRGGBBAA for Little Endian )
void assign(T r, T g, T b, T a)
Assign the RGBA colors, from each component.
void assign(const tColor<T>& Col)
Assign the color value from other RGBA color.