|
| | CColor () |
| | Class constructor.
|
| |
| | CColor (UInt8 un_red, UInt8 un_green, UInt8 un_blue, UInt8 un_alpha=255) throw () |
| | Class constructor.
|
| |
| Real | ToGrayScale () const throw () |
| | Returns the color in grayscale.
|
| |
| UInt8 | GetRed () const throw () |
| | Returns the red channel of the color.
|
| |
| void | SetRed (UInt8 un_red) throw () |
| | Sets the red channel of the color.
|
| |
| UInt8 | GetGreen () const throw () |
| | Returns the green channel of the color.
|
| |
| void | SetGreen (UInt8 un_green) throw () |
| | Sets the green channel of the color.
|
| |
| UInt8 | GetBlue () const throw () |
| | Returns the blue channel of the color.
|
| |
| void | SetBlue (UInt8 un_blue) throw () |
| | Sets the blue channel of the color.
|
| |
| UInt8 | GetAlpha () const throw () |
| | Returns the alpha channel of the color.
|
| |
| void | SetAlpha (UInt8 un_alpha) throw () |
| | Sets the alpha channel of the color.
|
| |
| void | Set (UInt8 un_red, UInt8 un_green, UInt8 un_blue, UInt8 un_alpha=255) throw () |
| | Sets the RGBA values of the color.
|
| |
| CColor | Blend (const CColor &c_background) const throw () |
| | Blends the current color with a background color.
|
| |
| void | Set (const std::string &str_color) |
| | Sets the RGBA values of the color from a string.
|
| |
| | operator UInt32 () |
| | Cast operator.
|
| |
| bool | operator== (const CColor &c_color2) const throw () |
| | Returns true if the given color is identical to the current.
|
| |
| bool | operator!= (const CColor &c_color2) const throw () |
| | Returns true if the given color is different from the current.
|
| |
The basic color type.
In ARGoS, color is encoded into the RGBA schema.
Definition at line 25 of file color.h.
| CColor argos::CColor::Blend |
( |
const CColor & | c_background | ) |
const |
| throw | ( | ) | | | |
|
inline |
Blends the current color with a background color.
The alpha channel of the current color is used for blending. When alpha = 1, this color is returned. When alpha = 0, the background color is returned. When alpha is in [0,1], the color is calculated as the weighted sum of the channel values. The weight is the alpha value.
Definition at line 144 of file color.h.
| void argos::CColor::Set |
( |
const std::string & | str_color | ) |
|
|
inline |
Sets the RGBA values of the color from a string.
The input stringcan contain predefined color names, such as red. The color can be also input as a tuple <r,g,b,a>.
- Parameters
-
| str_color | the input string. |
- Exceptions
-
Definition at line 160 of file color.h.
| std::ostream & operator<< |
( |
std::ostream & | os, |
|
|
const CColor & | c_color ) |
|
friend |
Output stream operator.
Operator to serialize a color into a C++ output stream. When a color corresponds to one of the predefined constants (such as argos::CColor::RED) it streams the color name. For instance, if the current color is argos::CColor::RED, the output is a string containing red. Otherwise, the color is output as a tuple <r,g,b,a>.
- Parameters
-
| os | the C++ output stream. |
| c_color | the color to stream. |
- Returns
- the new state of the C++ output stream.
Definition at line 235 of file color.h.