A class used for storing information about a color. More...
#include <TmxColor.h>
Public Member Functions | |
Color () | |
Default constructor for a fully transparent black color. | |
Color (uint32_t color) | |
Initialize the color with a 32 bit ARGB representation. | |
Color (uint8_t r, uint8_t g, uint8_t b, uint8_t a=255) | |
Initialize the color with a red, green, blue and optionally alpha values. | |
Color (const std::string &str) | |
Initialize a color from a string hexadecimal representation in the format "#AARRGGBB" or "#RRGGBB". | |
Color (const Color &)=default | |
Default copy constructor. | |
Color & | operator= (const Color &)=default |
Default asignment operator. | |
bool | operator== (const Color &o) |
Check if two colors have the exact same four components. | |
bool | operator!= (const Color &o) |
Check if two colors are different. | |
uint8_t | GetAlpha () const |
Get the alpha component of the color. | |
uint8_t | GetRed () const |
Get the red component of the color. | |
uint8_t | GetGreen () const |
Get the green component of the color. | |
uint8_t | GetBlue () const |
Get the blue component of the color. | |
bool | IsTransparent () const |
Return true if the color is fully transparent (ie alpha value is 0). | |
uint32_t | ToInt () const |
Get the 32 bits integer representing the color. The 8 highest bits are for the alpha channel, then the red, the green and the blue. | |
std::string | ToString () const |
Get a string representation of the color in the format "#AARRGGBB". | |
A class used for storing information about a color.