The common interface for colors used by DSGC. More...
#include <Color.h>
Public Member Functions | |
| Color () | |
| Default constructor which creates a black color with no transparency. | |
| Color (uint8_t red, uint8_t green, uint8_t blue) | |
| Copy constructor which copies the values from another Color object. | |
| Color (uint8_t red, uint8_t green, uint8_t blue, uint8_t alpha) | |
| Creates a color with 8-bit RGB values with specified transparency. | |
| Color (uint16_t rgb565) | |
| Creates a color from the RGB-565 representation. | |
| uint8_t | getRed () const |
| Gets the red component of the color in RGB color model. | |
| uint8_t | getGreen () const |
| Gets the green component of the color in RGB color model. | |
| uint8_t | getBlue () const |
| Gets the blue component of the color in RGB color model. | |
| uint8_t | getAlpha () const |
| Gets the alpha of the color. | |
| bool | operator== (const Color &rhs) const |
| Compares 2 Colors. | |
| void | setRed (uint8_t red) |
| Sets the red component of the color in RGB color model. | |
| void | setGreen (uint8_t green) |
| Sets the green component of the color in RGB color model. | |
| void | setBlue (uint8_t blue) |
| Sets the blue component of the color in RGB color model. | |
| void | setAlpha (uint8_t alpha) |
| Sets the alpha of the color. | |
| Color & | operator= (const Color &rhs) |
| Copies the values of another Color object to this Color object. | |
| operator uint16_t () const | |
| Gets the RGB-565 representation of this color. | |
| uint16_t | getRgb565 () const |
| Gets the RGB-565 representation of this color. | |
| uint32_t | getRgb888 () const |
| Gets the RGB-888 representation of this color. | |
| uint32_t | getArgb8888 () const |
| Gets the ARGB-8888 representation of this color. | |
| Color | getInverse () const |
| Gets the inverse of this color. | |
| uint8_t | getMaxRgbComponent () const |
| Gets the value of the largest component among the RGB components. | |
| uint8_t | getMinRgbComponent () const |
| Gets the value of the smallest component among the RGB components. | |
| int16_t | getHue () const |
| Gets the hue in HSI, HSV and HSL models. | |
| uint8_t | getIntensity () const |
| Gets the intensity in HSI model. | |
| uint8_t | getValue () const |
| Gets the value in HSV model. | |
| uint8_t | getLightness () const |
| Gets the lightness in HSL model. | |
Static Public Attributes | |
| static const Color | BLACK |
| The color black. | |
| static const Color | RED |
| The color red. | |
| static const Color | GREEN |
| The color green. | |
| static const Color | BLUE |
| The color blue. | |
| static const Color | YELLOW |
| The color yellow. | |
| static const Color | CYAN |
| The color cyan. | |
| static const Color | MAGENTA |
| The color magenta. | |
| static const Color | ORANGE |
| The color orange. | |
| static const Color | BROWN |
| The color brown. | |
| static const Color | PURPLE |
| The color purple. | |
| static const Color | NAVY |
| The color navy. | |
| static const Color | DARK_GREY |
| The color dark grey (1/3 brightness). | |
| static const Color | GREY |
| The color grey (1/2 brightness). | |
| static const Color | LIGHT_GREY |
| The color light grey (2/3 brightness). | |
| static const Color | WHITE |
| The color white. | |
The common interface for colors used by DSGC.
Speaking in experience, the color interface is never standardized across Arduino libraries.
| dsgc::Color::Color | ( | uint8_t | red, |
| uint8_t | green, | ||
| uint8_t | blue ) |
Copy constructor which copies the values from another Color object.
Creates an object that represents the same color as another Color object does.
| refColor | The other Color object whose color to be copied from. |
Creates a color with 8-bit RGB values with no transparency.
| red | The red component of the color [0 : 255]. |
| green | The green component of the color [0 : 255]. |
| blue | The blue component of the color [0 : 255]. |
| dsgc::Color::Color | ( | uint8_t | red, |
| uint8_t | green, | ||
| uint8_t | blue, | ||
| uint8_t | alpha ) |
Creates a color with 8-bit RGB values with specified transparency.
| red | The red component of the color [0 : 255]. |
| green | The green component of the color [0 : 255]. |
| blue | The blue component of the color [0 : 255]. |
| alpha | The alpha (i.e. inverse transparency) of the color [0 : 255]. |
| dsgc::Color::Color | ( | uint16_t | rgb565 | ) |
Creates a color from the RGB-565 representation.
| rgb565 | The RGB-565 value which represents the color. |
| uint8_t dsgc::Color::getAlpha | ( | ) | const |
Gets the alpha of the color.
The alpha of a color is the inverse of its transparency. The smaller the alpha, the more transparent a color is.
| uint32_t dsgc::Color::getArgb8888 | ( | ) | const |
Gets the ARGB-8888 representation of this color.
8 bits of alpha, 8 bits of red, 8 bits of green, 8 bits of blue.
| uint8_t dsgc::Color::getBlue | ( | ) | const |
Gets the blue component of the color in RGB color model.
| uint8_t dsgc::Color::getGreen | ( | ) | const |
Gets the green component of the color in RGB color model.
| int16_t dsgc::Color::getHue | ( | ) | const |
Gets the hue in HSI, HSV and HSL models.
| uint8_t dsgc::Color::getIntensity | ( | ) | const |
Gets the intensity in HSI model.
| dsgc::Color dsgc::Color::getInverse | ( | ) | const |
Gets the inverse of this color.
| uint8_t dsgc::Color::getLightness | ( | ) | const |
Gets the lightness in HSL model.
| uint8_t dsgc::Color::getMaxRgbComponent | ( | ) | const |
Gets the value of the largest component among the RGB components.
| uint8_t dsgc::Color::getMinRgbComponent | ( | ) | const |
Gets the value of the smallest component among the RGB components.
| uint8_t dsgc::Color::getRed | ( | ) | const |
Gets the red component of the color in RGB color model.
| uint16_t dsgc::Color::getRgb565 | ( | ) | const |
Gets the RGB-565 representation of this color.
5 bits of red, 6 bits of green, 5 bits of blue.
| uint32_t dsgc::Color::getRgb888 | ( | ) | const |
Gets the RGB-888 representation of this color.
8 bits of red, 8 bits of green, 8 bits of blue.
| uint8_t dsgc::Color::getValue | ( | ) | const |
Gets the value in HSV model.
| dsgc::Color::operator uint16_t | ( | ) | const |
Gets the RGB-565 representation of this color.
5 bits of red, 6 bits of green, 5 bits of blue.
| dsgc::Color & dsgc::Color::operator= | ( | const Color & | rhs | ) |
| bool dsgc::Color::operator== | ( | const Color & | rhs | ) | const |
Compares 2 Colors.
| void dsgc::Color::setAlpha | ( | uint8_t | alpha | ) |
Sets the alpha of the color.
The alpha of a color is the inverse of its transparency. The smaller the alpha, the more transparent a color is.
| alpha | The 8-bit alpha of the color [0 : 255]. |
| void dsgc::Color::setBlue | ( | uint8_t | blue | ) |
Sets the blue component of the color in RGB color model.
| blue | The 8-bit blue component of the color in RGB color model [0 : 255]. |
| void dsgc::Color::setGreen | ( | uint8_t | green | ) |
Sets the green component of the color in RGB color model.
| green | The 8-bit green component of the color in RGB color model [0 : 255]. |
| void dsgc::Color::setRed | ( | uint8_t | red | ) |
Sets the red component of the color in RGB color model.
| red | The 8-bit red component of the color in RGB color model [0 : 255]. |