The basic color type. More...
#include <color.h>
Public Member Functions | |
CColor () | |
Class constructor. More... | |
CColor (UInt8 un_red, UInt8 un_green, UInt8 un_blue, UInt8 un_alpha=255) throw () | |
Class constructor. More... | |
Real | ToGrayScale () const throw () |
Returns the color in grayscale. More... | |
UInt8 | GetRed () const throw () |
Returns the red channel of the color. More... | |
void | SetRed (UInt8 un_red) throw () |
Sets the red channel of the color. More... | |
UInt8 | GetGreen () const throw () |
Returns the green channel of the color. More... | |
void | SetGreen (UInt8 un_green) throw () |
Sets the green channel of the color. More... | |
UInt8 | GetBlue () const throw () |
Returns the blue channel of the color. More... | |
void | SetBlue (UInt8 un_blue) throw () |
Sets the blue channel of the color. More... | |
UInt8 | GetAlpha () const throw () |
Returns the alpha channel of the color. More... | |
void | SetAlpha (UInt8 un_alpha) throw () |
Sets the alpha channel of the color. More... | |
void | Set (UInt8 un_red, UInt8 un_green, UInt8 un_blue, UInt8 un_alpha=255) throw () |
Sets the RGBA values of the color. More... | |
CColor | Blend (const CColor &c_background) const throw () |
Blends the current color with a background color. More... | |
void | Set (const std::string &str_color) |
Sets the RGBA values of the color from a string. More... | |
operator UInt32 () | |
Cast operator. More... | |
bool | operator== (const CColor &c_color2) const throw () |
Returns true if the given color is identical to the current. More... | |
bool | operator!= (const CColor &c_color2) const throw () |
Returns true if the given color is different from the current. More... | |
Static Public Attributes | |
static CColor | BLACK |
static CColor | WHITE |
static CColor | RED |
static CColor | GREEN |
static CColor | BLUE |
static CColor | MAGENTA |
static CColor | CYAN |
static CColor | YELLOW |
static CColor | ORANGE |
static CColor | BROWN |
static CColor | PURPLE |
static CColor | GRAY10 |
static CColor | GRAY20 |
static CColor | GRAY30 |
static CColor | GRAY40 |
static CColor | GRAY50 |
static CColor | GRAY60 |
static CColor | GRAY70 |
static CColor | GRAY80 |
static CColor | GRAY90 |
The basic color type.
In ARGoS, color is encoded into the RGBA schema.
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.
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
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>
.
str_color | the input string. |
CARGoSException | in case of a parse error. |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |