class: etk::Color


Description:

The color class is a template to abstract the color implementation choice.
It is important to note that the color choice denpznd on the level of developent. For example : Then with this class we abstract the transformation format and set an easy same way to use the color independing of the developpement level.
Some of the basic color is defined in the namespace: [namespace[etk::color]].

Associated Namespace:

Constructor and Destructor:

+                  Color        (void );
+ Color (double _r,
double _g,
double _b,
double _a);
+ Color (float _r,
float _g,
float _b,
float _a);
+ Color (uint8_t _r,
uint8_t _g,
uint8_t _b,
uint8_t _a);
+ Color (int _r,
int _g,
int _b,
int _a);
+ Color (uint32_t _input);
+ Color (const etk::Color<float> & _obj);
+ Color (const etk::Color<uint8_t> & _obj);
+ Color (const std::string & _input);

Synopsis:

+ Color<MY_TYPE> & operator =   (const etk::Color<MY_TYPE> & _input);
+ bool operator != (const etk::Color<MY_TYPE> & _obj) const;
+ bool operator == (const etk::Color<MY_TYPE> & _obj) const;
+ uint32_t get (void ) const;
+ void set (float _r,
float _g,
float _b,
float _a);
+ void set (uint8_t _r,
uint8_t _g,
uint8_t _b,
uint8_t _a);
+ void set (int _r,
int _g,
int _b,
int _a);
+ std::string getHexString (void ) const;
+ std::string getString (void ) const;
+ MY_TYPE r (void ) const;
+ MY_TYPE g (void ) const;
+ MY_TYPE b (void ) const;
+ MY_TYPE a (void ) const;
+ void setR (MY_TYPE _r);
+ void setG (MY_TYPE _g);
+ void setB (MY_TYPE _b);
+ void setA (MY_TYPE _a);

Detail:

Color

+  Color (void );
Constructor. It does not initialise element of class.


Color

+  Color (double _r,
double _g,
double _b,
double _a);
+ Color (float _r,
float _g,
float _b,
float _a);
+ Color (uint8_t _r,
uint8_t _g,
uint8_t _b,
uint8_t _a);
+ Color (int _r,
int _g,
int _b,
int _a);
Contructor with request initialisation.


Color

+  Color (uint32_t _input);
Constructor with the single integer input.
Note: Not forger the alpha blending at the end


Color

+  Color (const etk::Color<float> & _obj);
+ Color (const etk::Color<uint8_t> & _obj);
Copy contructor or convert contructor


Color

+  Color (const std::string & _input);
String extractor constructor.


operator =

+ Color<MY_TYPE> & operator = (const etk::Color<MY_TYPE> & _input);
Asignemement operator


operator !=

+ bool operator != (const etk::Color<MY_TYPE> & _obj) const;
Different comparaison operator.


operator ==

+ bool operator == (const etk::Color<MY_TYPE> & _obj) const;
Equality comparaison operator.


get

+ uint32_t get (void ) const;


set

+ void set (float _r,
float _g,
float _b,
float _a);
+ void set (uint8_t _r,
uint8_t _g,
uint8_t _b,
uint8_t _a);
+ void set (int _r,
int _g,
int _b,
int _a);
Set the specified color elements.


getHexString

+ std::string getHexString (void ) const;
Convert the color in an hexedecimal string ("0xFEDCBA98")


getString

+ std::string getString (void ) const;
Convert the color in an generic string value ("#FEDCBA98")


r

+ MY_TYPE r (void ) const;
Get red color.


g

+ MY_TYPE g (void ) const;
Get green color.


b

+ MY_TYPE b (void ) const;
Get blue color.


a

+ MY_TYPE a (void ) const;
Get alpha blending.


setR

+ void setR (MY_TYPE _r);
Set red color.


setG

+ void setG (MY_TYPE _g);
Set green color.


setB

+ void setB (MY_TYPE _b);
Set blue color.


setA

+ void setA (MY_TYPE _a);
Set alpha blending.