Representation for the hue-saturation-lightness-alpha color model.
See Wikipedia for details on color models.
Definition at line 151 of file ge211_color.h.
Public Member Functions | |
Color | to_rgba () const noexcept |
Converts color to the RGBA color model. | |
Transformations | |
HSLA | rotate_hue (double degrees) const noexcept |
Returns a color by rotating the hue, leaving the other properties. | |
HSLA | saturate (double unit_amount) const noexcept |
Produces a fuller tone by saturating the color. More... | |
HSLA | desaturate (double unit_amount) const noexcept |
Produces a weaker tone by desaturating the color. More... | |
HSLA | lighten (double unit_amount) const noexcept |
Produces a tint by lightening the color. More... | |
HSLA | darken (double unit_amount) const noexcept |
Produces a shade by darkening the color. More... | |
HSLA | fade_in (double unit_amount) const noexcept |
Increases opacity of the color. More... | |
HSLA | fade_out (double unit_amount) const noexcept |
Decreases opacity of the color. More... | |
Public Attributes | |
double | hue |
The hue in degrees from 0 to 360. More... | |
double | saturation |
The fullness of the color, from 0.0 (grey) to 1.0 (fully saturated). More... | |
double | lightness |
The lightness of the color, from 0.0 (black) to 1.0 (white). | |
double | alpha |
The opacity of the color, from 0.0 (fully transparent) to 1.0 (fully opaque). More... | |
|
noexcept |
Produces a shade by darkening the color.
The unit_amount
must be between 0 and 1, where 0 leaves the color the same, and 1 produces black.
Definition at line 211 of file ge211_color.cpp.
|
noexcept |
Produces a weaker tone by desaturating the color.
The unit_amount
must be between 0 and 1, where 0 leaves the color the same, and 1 produces gray at the same lightness as the original color.
Definition at line 201 of file ge211_color.cpp.
|
noexcept |
Increases opacity of the color.
The unit_amount
must be between 0 and 1, where 0 leaves the color the same, and 1 produces a fully opaque color.
Definition at line 216 of file ge211_color.cpp.
|
noexcept |
Decreases opacity of the color.
The // unit_amount
must be between 0 and 1, where 0 leaves the color the same, and 1 produces full transparency.
Definition at line 221 of file ge211_color.cpp.
|
noexcept |
Produces a tint by lightening the color.
The amount
must be between 0 and 1, where 0 leaves the color the same, and 1 produces white.
Definition at line 206 of file ge211_color.cpp.
|
noexcept |
Produces a fuller tone by saturating the color.
The unit_amount
must be between 0 and 1, where 0 leaves the color the same, and 1 produces a fully saturated color.
Definition at line 196 of file ge211_color.cpp.
double alpha |
The opacity of the color, from 0.0 (fully transparent) to 1.0 (fully opaque).
Definition at line 162 of file ge211_color.h.
double hue |
The hue in degrees from 0 to 360.
0° (and 360°) is red, 120° is green, and 240° is blue.
Definition at line 154 of file ge211_color.h.
double saturation |
The fullness of the color, from 0.0 (grey) to 1.0 (fully saturated).
Definition at line 157 of file ge211_color.h.