![]() |
rag
graphic 2d engine
|
Represents RGBA color. More...
#include <Color.h>
Public Member Functions | |
Color (float r=1, float g=1, float b=1, float a=1) | |
Construts a Color object default to white. | |
Color (std::string color) | |
Construts a Color object with a string representing the color in hexadecimal. More... | |
unsigned int | toRGBA () const |
Writes the color in a single 32 bit int. | |
unsigned int | toABGR () const |
Writes the color in a single 32 bit int reversed. | |
Color & | operator*= (const Color &rhs) |
Color & | operator*= (float value) |
Color & | operator/= (const Color &rhs) |
Color & | operator/= (float value) |
Color & | operator+= (const Color &rhs) |
const Color | operator* (const Color &rhs) const |
const Color | operator* (float value) const |
const Color | operator/ (const Color &rhs) const |
const Color | operator/ (float value) const |
const Color | operator+ (const Color &rhs) const |
bool | operator== (const Color &rhs) |
bool | operator!= (const Color &rhs) |
std::string | toString () |
Returns a string representation of the Color object. | |
Static Public Member Functions | |
static unsigned int | createRGBA (int r, int g, int b, int a) |
Returns an unsigned int from color values. | |
static unsigned int | createABGR (int r, int g, int b, int a) |
Returns an unsigned int from color values. | |
Public Attributes | |
float | r |
float | g |
float | b |
float | a |
Static Public Attributes | |
static const Color | black |
static const Color | white |
Represents RGBA color.
Provides functionality to operate with colors.
Color::Color | ( | std::string | color | ) |
Construts a Color object with a string representing the color in hexadecimal.
The expected format of the string is like [x|#]RRGGBB[AA].