Represents a 4 channel color: {Red, Green, Blue, Alpha}.
More...
#include <color.h>
|
|
using | channel_type = float |
|
|
void | clamp () |
| | clamp each channel to the [0 - 1] range
|
| void | operator+= (const color &aOther) |
| | add two colors together.
|
|
constexpr bool | operator== (const color &aOther) const =default |
| | equality semantics
|
|
| color (const color &)=default |
| | copy semantics
|
|
color & | operator= (const color &acolor)=default |
| | copy semantics
|
|
| color (color &&)=default |
| | move semantics
|
|
color & | operator= (color &&acolor)=default |
| | move semantics
|
|
| color ()=default |
| | constructs a color as opaque black
|
|
constexpr | color (const channel_type aR, const channel_type aG, const channel_type aB, const channel_type aA=1) |
| | constructs a color with provided channel values. Alpha has a default opaque value
|
|
|
channel_type | r = 0 |
|
channel_type | g = 0 |
|
channel_type | b = 0 |
|
channel_type | a = 1 |
|
|
static const color | black {0.0f, 0.0f, 0.0f, 1.0f} |
| | opaque black color
|
|
static const color | white {1.0f, 1.0f, 1.0f, 1.0f} |
| | opaque white color
|
|
static const color | red {1.0f, 0.0f, 0.0f, 1.0f} |
| | opaque red color
|
|
static const color | green {0.0f, 1.0f, 0.0f, 1.0f} |
| | opaque green color
|
|
static const color | dark_green {0.0f, 0.6f, 0.0f, 1.0f} |
| | opaque dark green color
|
|
static const color | blue {0.0f, 0.0f, 1.0f, 1.0f} |
| | opaque blue color
|
| static const color | deathly_pink {1.0f, 0.2f, 0.8f, 1.0f} |
| static const color | cornflower_blue |
| | an opaque pastel blue color
|
Represents a 4 channel color: {Red, Green, Blue, Alpha}.
◆ operator+=()
| void gdk::graphics::color::operator+= |
( |
const color & | aOther | ) |
|
add two colors together.
- Warning
- does not clamp values within the normalized range
◆ cornflower_blue
| const color gdk::graphics::color::cornflower_blue |
|
inlinestatic |
Initial value:{
0.3921568627450980392156862745098f,
0.58431372549019607843137254901961f,
0.92941176470588235294117647058824f,
1.0f
}
an opaque pastel blue color
◆ deathly_pink
| const color gdk::graphics::color::deathly_pink {1.0f, 0.2f, 0.8f, 1.0f} |
|
inlinestatic |
opaque bright pink color, useful for indicating color-related errors (stands out against most palettes)
The documentation for this struct was generated from the following file:
- /home/runner/work/gdk-graphics/gdk-graphics/data/include/gdk/graphics/color.h