#include <color.hpp>
Definition at line 67 of file color.hpp.
Public Member Functions | |
| Color () | |
| Constructor. | |
| Color (int color) | |
| Constructs a color from the bytes in an integer. | |
| Color (int r, int g, int b, int a=255) | |
| Constructor. | |
| Color | operator+ (const Color &color) const |
| Adds the RGB values of two colors together. | |
| Color | operator- (const Color &color) const |
| Subtracts the RGB values of one color from another. | |
| Color | operator * (float value) const |
| Multiplies the RGB values of a color with a float value. | |
| bool | operator== (const Color &color) const |
| Compares two colors. | |
| bool | operator!= (const Color &color) const |
| Compares two colors. | |
Public Attributes | |
| int | r |
| Red color component (range 0-255). | |
| int | g |
| Green color component (range 0-255). | |
| int | b |
| Blue color component (range 0-255). | |
| int | a |
| Color alpha, used for transparency. | |
| gcn::Color::Color | ( | ) |
| gcn::Color::Color | ( | int | color | ) |
Constructs a color from the bytes in an integer.
Call it with a hexadecimal constant for HTML-style color representation. The alpha component will be set to 255.
EXAMPLE: Color(0xff50a0) constructs Gui-chan's favourite color.
NOTE: Because of this constructor, integers will be automatically casted to a color by your compiler.
| color | the color. |
| gcn::Color::Color | ( | int | r, | |
| int | g, | |||
| int | b, | |||
| int | a = 255 | |||
| ) |
| Color gcn::Color::operator * | ( | float | value | ) | const |
| bool gcn::Color::operator!= | ( | const Color & | color | ) | const |
| bool gcn::Color::operator== | ( | const Color & | color | ) | const |
| int gcn::Color::a |
Color alpha, used for transparency.
A value of 0 means totaly transparent, 255 is totaly opaque (the default)
Definition at line 161 of file color.hpp.
Referenced by Color(), gcn::Window::draw(), gcn::Slider::draw(), gcn::DropDown::draw(), gcn::Button::draw(), gcn::Window::drawBorder(), gcn::TextField::drawBorder(), gcn::Slider::drawBorder(), gcn::ScrollArea::drawBorder(), gcn::RadioButton::drawBorder(), gcn::ListBox::drawBorder(), gcn::Label::drawBorder(), gcn::Icon::drawBorder(), gcn::DropDown::drawBorder(), gcn::Container::drawBorder(), gcn::CheckBox::drawBorder(), gcn::Button::drawBorder(), gcn::RadioButton::drawBox(), gcn::CheckBox::drawBox(), gcn::DropDown::drawButton(), gcn::ScrollArea::drawDownButton(), gcn::ScrollArea::drawHBar(), gcn::SDLGraphics::drawHLine(), gcn::ScrollArea::drawHMarker(), gcn::ScrollArea::drawLeftButton(), gcn::Slider::drawMarker(), gcn::ScrollArea::drawRightButton(), gcn::ScrollArea::drawUpButton(), gcn::ScrollArea::drawVBar(), gcn::SDLGraphics::drawVLine(), gcn::ScrollArea::drawVMarker(), gcn::SDLGraphics::fillRectangle(), operator *(), operator!=(), operator+(), operator-(), operator==(), gcn::OpenGLImage::putPixel(), gcn::AllegroImage::putPixel(), gcn::SDLputPixelAlpha(), gcn::SDLGraphics::setColor(), gcn::OpenGLGraphics::setColor(), and gcn::AllegroGraphics::setColor().
1.4.7