Represents a color, with 4 channels.
More...
|
| Color () noexcept |
|
| Color (unsigned char r, unsigned char g, unsigned char b, unsigned char a=255) noexcept |
|
| Color (float r, float g, float b, float a=1.f) noexcept |
|
| Color (double r, double g, double b, double a=1.0) noexcept |
|
| Color (unsigned int r, unsigned int g, unsigned int b, unsigned int a=255u) noexcept |
|
| Color (unsigned long long r, unsigned long long g, unsigned long long b, unsigned long long a=255ull) noexcept |
|
| Color (int r, int g, int b, int a=255) noexcept |
|
| Color (long long r, long long g, long long b, long long a=255ll) noexcept |
|
| ~Color () |
|
float | getR () const |
|
float | getG () const |
|
float | getB () const |
|
float | getA () const |
|
unsigned int | getR255 () const |
|
unsigned int | getG255 () const |
|
unsigned int | getB255 () const |
|
unsigned int | getA255 () const |
|
Color | getAssociateColor (float factor=1.5f) const |
|
Color | mix (const Color &other, float factor) const |
|
Color | getColorForDepth (unsigned int depth) const |
|
Color | operator* (float factor) const |
|
Represents a color, with 4 channels.
◆ Color() [1/8]
nkWinUi::Color::Color |
( |
| ) |
|
|
noexcept |
Default constructor. Will default to a full black color.
◆ Color() [2/8]
nkWinUi::Color::Color |
( |
unsigned char |
r, |
|
|
unsigned char |
g, |
|
|
unsigned char |
b, |
|
|
unsigned char |
a = 255 |
|
) |
| |
|
explicitnoexcept |
Unsigned char constructor.
- Parameters
-
r | The red component of the color. |
g | The green component of the color. |
b | The blue component of the color. |
a | The alpha component of the color. |
◆ Color() [3/8]
nkWinUi::Color::Color |
( |
float |
r, |
|
|
float |
g, |
|
|
float |
b, |
|
|
float |
a = 1.f |
|
) |
| |
|
explicitnoexcept |
Float constructor.
- Parameters
-
r | The red component of the color. |
g | The green component of the color. |
b | The blue component of the color. |
a | The alpha component of the color. |
◆ Color() [4/8]
nkWinUi::Color::Color |
( |
double |
r, |
|
|
double |
g, |
|
|
double |
b, |
|
|
double |
a = 1.0 |
|
) |
| |
|
explicitnoexcept |
Double constructor.
- Parameters
-
r | The red component of the color. |
g | The green component of the color. |
b | The blue component of the color. |
a | The alpha component of the color. |
◆ Color() [5/8]
nkWinUi::Color::Color |
( |
unsigned int |
r, |
|
|
unsigned int |
g, |
|
|
unsigned int |
b, |
|
|
unsigned int |
a = 255u |
|
) |
| |
|
explicitnoexcept |
Unsigned int constructor.
- Parameters
-
r | The red component of the color. |
g | The green component of the color. |
b | The blue component of the color. |
a | The alpha component of the color. |
◆ Color() [6/8]
nkWinUi::Color::Color |
( |
unsigned long long |
r, |
|
|
unsigned long long |
g, |
|
|
unsigned long long |
b, |
|
|
unsigned long long |
a = 255ull |
|
) |
| |
|
explicitnoexcept |
Unsigned long long constructor.
- Parameters
-
r | The red component of the color. |
g | The green component of the color. |
b | The blue component of the color. |
a | The alpha component of the color. |
◆ Color() [7/8]
nkWinUi::Color::Color |
( |
int |
r, |
|
|
int |
g, |
|
|
int |
b, |
|
|
int |
a = 255 |
|
) |
| |
|
explicitnoexcept |
Int constructor.
- Parameters
-
r | The red component of the color. |
g | The green component of the color. |
b | The blue component of the color. |
a | The alpha component of the color. |
◆ Color() [8/8]
nkWinUi::Color::Color |
( |
long long |
r, |
|
|
long long |
g, |
|
|
long long |
b, |
|
|
long long |
a = 255ll |
|
) |
| |
|
explicitnoexcept |
Long long constructor.
- Parameters
-
r | The red component of the color. |
g | The green component of the color. |
b | The blue component of the color. |
a | The alpha component of the color. |
◆ ~Color()
nkWinUi::Color::~Color |
( |
| ) |
|
◆ getR()
float nkWinUi::Color::getR |
( |
| ) |
const |
- Returns
- The r channel component value, as stored internally (scaled over 0.f - 1.f).
◆ getG()
float nkWinUi::Color::getG |
( |
| ) |
const |
- Returns
- The g channel component value, as stored internally (scaled over 0.f - 1.f).
◆ getB()
float nkWinUi::Color::getB |
( |
| ) |
const |
- Returns
- The b channel component value, as stored internally (scaled over 0.f - 1.f).
◆ getA()
float nkWinUi::Color::getA |
( |
| ) |
const |
- Returns
- The a channel component value, as stored internally (scaled over 0.f - 1.f).
◆ getR255()
unsigned int nkWinUi::Color::getR255 |
( |
| ) |
const |
- Returns
- The r channel component value, rescaled to the range 0 - 255.
◆ getG255()
unsigned int nkWinUi::Color::getG255 |
( |
| ) |
const |
- Returns
- The g channel component value, rescaled to the range 0 - 255.
◆ getB255()
unsigned int nkWinUi::Color::getB255 |
( |
| ) |
const |
- Returns
- The b channel component value, rescaled to the range 0 - 255.
◆ getA255()
unsigned int nkWinUi::Color::getA255 |
( |
| ) |
const |
- Returns
- The a channel component value, rescaled to the range 0 - 255.
◆ getAssociateColor()
Color nkWinUi::Color::getAssociateColor |
( |
float |
factor = 1.5f | ) |
const |
Returns the "associate" color.
- Parameters
-
factor | The factor to apply to this color. |
- Returns
- The "associate" color, after application of the factor.
◆ mix()
Color nkWinUi::Color::mix |
( |
const Color & |
other, |
|
|
float |
factor |
|
) |
| const |
Mixes with another color.
- Parameters
-
other | The color to mix with. |
factor | The factor, [0.f, 1.f], between this color (0.f) and the other one (1.f). |
- Returns
- The color mix requested.
◆ getColorForDepth()
Color nkWinUi::Color::getColorForDepth |
( |
unsigned int |
depth | ) |
const |
Automatically creates the color associated to the color, to give a sense of "depth" within the interface.
- Parameters
-
depth | The depth that should be associated to the color returned. Currently, between [0, 10]. |
- Returns
- The color expressed for given depth.
◆ operator*()
Color nkWinUi::Color::operator* |
( |
float |
factor | ) |
const |
Overridden operator for fast scalar application.
- Parameters
-
factor | The factor to multiply with. |
- Returns
- The color with all of its component multiplied by the factor.
The documentation for this class was generated from the following file:
- Documentation/Headers/NilkinsWinUi/Themes/Color.h