blip
0.1
|
A color with red, green, blue, and alpha components. More...
#include <Color.hpp>
Public Member Functions | |
Color (uint32_t rgba) throw () | |
Construct a new Color from the given packed 32-bit RGBA representation. More... | |
Color (uint8_t red=0, uint8_t green=0, uint8_t blue=0, uint8_t alpha=255) throw () | |
Construct a new Color with the given red, green, blue, and alpha components. More... | |
~Color () throw () | |
Destructor. More... | |
void | setRed (uint8_t red) throw () |
Set the red component of the color. More... | |
uint8_t | getRed () const throw () |
Get the red component of the color. More... | |
void | setGreen (uint8_t green) throw () |
Set the green component of the color. More... | |
uint8_t | getGreen () const throw () |
Get the green component of the color. More... | |
void | setBlue (uint8_t blue) throw () |
Set the blue component of the color. More... | |
uint8_t | getBlue () const throw () |
Get the blue component of the color. More... | |
void | setAlpha (uint8_t alpha) throw () |
Set the alpha component of the color. More... | |
uint8_t | getAlpha () const throw () |
Get the alpha component of the color. More... | |
void | setColor (int red, int green, int blue, int alpha) throw () |
Set all components of the color. More... | |
void | setRGBA (uint32_t rgba) throw () |
Set the color from the 32-bit packed RGBA representation. More... | |
uint32_t | toRGBA () const throw () |
Get the color's 32-bit packed RGBA representation. More... | |
void | getHSL (float *hue, float *saturation, float *lightness) const throw () |
Get the hue, saturation, and lightness values for this color. More... | |
void | setHSL (float hue, float saturation, float lightness) throw () |
Set this color using hue, saturation, and lightness values. More... | |
Static Public Attributes | |
static const Color | BLACK |
Black (#000000) More... | |
static const Color | BLUE |
Blue (#0000FF) More... | |
static const Color | CYAN |
Cyan (#00FFFF) More... | |
static const Color | DARK_BLUE |
Dark blue (#000080) More... | |
static const Color | DARK_CYAN |
Dark cyan (#008080) More... | |
static const Color | DARK_GRAY |
Dark gray (#808080) More... | |
static const Color | DARK_GREEN |
Dark green (#008000) More... | |
static const Color | DARK_MAGENTA |
Dark magenta (#800080) More... | |
static const Color | DARK_RED |
Dark red (#800000) More... | |
static const Color | DARK_YELLOW |
Dark yellow (#808000) More... | |
static const Color | GRAY |
Gray (#A0A0A0) More... | |
static const Color | GREEN |
Green (#00FF00) More... | |
static const Color | LIGHT_GRAY |
Light gray (#C0C0C0) More... | |
static const Color | MAGENTA |
Magenta (#FF00FF) More... | |
static const Color | RED |
Red (#FF0000) More... | |
static const Color | TRANSPARENT |
Transparent black. More... | |
static const Color | WHITE |
White (#FFFFFF) More... | |
static const Color | YELLOW |
Yellow (#FFFF00) More... | |
A color with red, green, blue, and alpha components.
|
explicit |
Construct a new Color from the given packed 32-bit RGBA representation.
Color | ( | uint8_t | red = 0 , |
uint8_t | green = 0 , |
||
uint8_t | blue = 0 , |
||
uint8_t | alpha = 255 |
||
) | |||
throw | ( | ||
) |
Construct a new Color with the given red, green, blue, and alpha components.
~Color | ( | ) | ||
throw | ( | |||
) |
Destructor.
|
inline |
Get the alpha component of the color.
|
inline |
Get the blue component of the color.
|
inline |
Get the green component of the color.
void getHSL | ( | float * | hue, |
float * | saturation, | ||
float * | lightness | ||
) | const | ||
throw | ( | ||
) |
Get the hue, saturation, and lightness values for this color.
|
inline |
Get the red component of the color.
|
inline |
Set the alpha component of the color.
|
inline |
Set the blue component of the color.
void setColor | ( | int | red, |
int | green, | ||
int | blue, | ||
int | alpha | ||
) | |||
throw | ( | ||
) |
Set all components of the color.
|
inline |
Set the green component of the color.
void setHSL | ( | float | hue, |
float | saturation, | ||
float | lightness | ||
) | |||
throw | ( | ||
) |
Set this color using hue, saturation, and lightness values.
|
inline |
Set the red component of the color.
void setRGBA | ( | uint32_t | rgba | ) | |
throw | ( | ||||
) |
Set the color from the 32-bit packed RGBA representation.
uint32_t toRGBA | ( | ) | const | |
throw | ( | |||
) |
Get the color's 32-bit packed RGBA representation.
|
static |
Black (#000000)
|
static |
Blue (#0000FF)
|
static |
Cyan (#00FFFF)
|
static |
Dark blue (#000080)
|
static |
Dark cyan (#008080)
|
static |
Dark gray (#808080)
|
static |
Dark green (#008000)
|
static |
Dark magenta (#800080)
|
static |
Dark red (#800000)
|
static |
Dark yellow (#808000)
|
static |
Gray (#A0A0A0)
|
static |
Green (#00FF00)
|
static |
Light gray (#C0C0C0)
|
static |
Magenta (#FF00FF)
|
static |
Red (#FF0000)
|
static |
Transparent black.
|
static |
White (#FFFFFF)
|
static |
Yellow (#FFFF00)