RGBA color on a standard 0 to 255 scale. For the alpha channel 0 is transparent and 255 is opaque.
More...
#include <lecui.h>
RGBA color on a standard 0 to 255 scale. For the alpha channel 0 is transparent and 255 is opaque.
◆ color()
liblec::lecui::color::color |
( |
const unsigned short |
red, |
|
|
const unsigned short |
green, |
|
|
const unsigned short |
blue, |
|
|
const unsigned short |
alpha |
|
) |
| |
Color constructor.
- Parameters
-
red | The red channel, on a scale of 0 to 255. |
green | The green channel, on a scale of 0 to 255. |
blue | The blue channel, on a scale of 0 to 255. |
alpha | The alpha channel, on a scale of 0 to 255. |
◆ alpha() [1/2]
unsigned short & liblec::lecui::color::alpha |
( |
| ) |
|
Get or set the alpha property.
- Returns
- A reference to the property, from 0 to 255 inclusive.
◆ alpha() [2/2]
color & liblec::lecui::color::alpha |
( |
const unsigned short & |
alpha | ) |
|
Set the alpha property.
- Parameters
-
alpha | The property, from 0 to 255 inclusive. |
- Returns
- A reference to the modified object.
◆ blue() [1/2]
unsigned short & liblec::lecui::color::blue |
( |
| ) |
|
Get or set the blue property.
- Returns
- A reference to the property, from 0 to 255 inclusive.
◆ blue() [2/2]
color & liblec::lecui::color::blue |
( |
const unsigned short & |
blue | ) |
|
Set the blue property.
- Parameters
-
blue | The property, from 0 to 255 inclusive. |
- Returns
- A reference to the modified object.
◆ darken()
color & liblec::lecui::color::darken |
( |
const float & |
percentage | ) |
|
Darken the color.
- Parameters
-
percentage | The percentage to darken by. |
- Returns
- A reference to the modified object.
◆ get_alpha()
unsigned short liblec::lecui::color::get_alpha |
( |
| ) |
const |
Get the alpha property.
- Returns
- The property, from 0 to 255 inclusive.
◆ get_blue()
unsigned short liblec::lecui::color::get_blue |
( |
| ) |
const |
Get the blue property.
- Returns
- The property, from 0 to 255 inclusive.
◆ get_green()
unsigned short liblec::lecui::color::get_green |
( |
| ) |
const |
Get the green property.
- Returns
- The property, from 0 to 255 inclusive.
◆ get_red()
unsigned short liblec::lecui::color::get_red |
( |
| ) |
const |
Get the red property.
- Returns
- The property, from 0 to 255 inclusive.
◆ green() [1/2]
unsigned short & liblec::lecui::color::green |
( |
| ) |
|
Get or set the green property.
- Returns
- A reference to the property, from 0 to 255 inclusive.
◆ green() [2/2]
color & liblec::lecui::color::green |
( |
const unsigned short & |
green | ) |
|
Set the green property.
- Parameters
-
green | The property, from 0 to 255 inclusive. |
- Returns
- A reference to the modified object.
◆ lighten()
color & liblec::lecui::color::lighten |
( |
const float & |
percentage | ) |
|
Lighten the color.
- Parameters
-
percentage | The percentage to lighten by. |
- Returns
- A reference to the modified object.
◆ operator!=()
bool liblec::lecui::color::operator!= |
( |
const color & |
param | ) |
|
Check whether two colors are NOT equal. All properties are considered.
- Parameters
-
param | The color to compare to. |
- Returns
- Returns true if the colors are NOT equal, else returns false.
◆ operator==()
bool liblec::lecui::color::operator== |
( |
const color & |
param | ) |
|
Check whether two colors are equal. All properties are considered.
- Parameters
-
param | The color to compare to. |
- Returns
- Returns true if the colors are equal, else returns false.
◆ red() [1/2]
unsigned short & liblec::lecui::color::red |
( |
| ) |
|
Get or set the red property.
- Returns
- A reference to the property, from 0 to 255 inclusive.
◆ red() [2/2]
color & liblec::lecui::color::red |
( |
const unsigned short & |
red | ) |
|
Set the red property.
- Parameters
-
red | The property, from 0 to 255 inclusive. |
- Returns
- A reference to the modified object.
The documentation for this class was generated from the following file: