|
aest 0.1.0
Collection of C++ utility libraries
|
A color in OKLCH: OKLab in polar form, as lightness, chroma and hue. More...
Public Member Functions | |
| constexpr | OKLCH () |
| Default constructor initializes the color to opaque black (0, 0, 0, 1). | |
| constexpr | OKLCH (const float l, const float c, const float h, const float alpha=1.0f) |
| Construct a color from OKLCH values and alpha. | |
Color Channels | |
| constexpr float | lightness () const noexcept |
| Get the perceived lightness, 1 being D65 white. | |
| constexpr float | chroma () const noexcept |
| Get the chroma, the distance from gray. | |
| constexpr float | hue () const noexcept |
| Get the hue angle in the 0-360 range. | |
| Public Member Functions inherited from aest::colors::ColorBase< OKLCH > | |
| constexpr float | alpha () const noexcept |
| Get the alpha channel value in the 0-1 range. | |
| constexpr float | ch1 () const noexcept |
| Get the first channel value. | |
| constexpr float | ch2 () const noexcept |
| Get the second channel value. | |
| constexpr float | ch3 () const noexcept |
| Get the third channel value. | |
| constexpr OKLCH | opacity (const float alpha) const |
| Returns a new color with the same channels and the specified alpha value. | |
Static Public Attributes | |
| static constexpr std::string_view | TYPE = "OKLCH" |
| Color space name, used by the std::formatter specialization. | |
Additional Inherited Members | |
| Public Attributes inherited from aest::colors::ColorBase< OKLCH > | |
| friend | Derived |
| Lets the derived color reach the private constructor and channels. | |
A color in OKLCH: OKLab in polar form, as lightness, chroma and hue.
Chroma is the distance from gray and hue the angle around it, so changing one leaves the other two and the perceived lightness alone, unlike HSL. The hue is wrapped to the [0, 360) range and chroma clamped at 0; for grays, whose chroma is 0, the hue has no meaning. Lightness is not clamped.
Definition at line 110 of file OkLab.cppm.
|
inlineconstexpr |
Default constructor initializes the color to opaque black (0, 0, 0, 1).
Definition at line 117 of file OkLab.cppm.
|
inlineconstexpr |
Construct a color from OKLCH values and alpha.
| [in] | l | Perceived lightness, 1 being D65 white |
| [in] | c | Chroma, clamped at 0 |
| [in] | h | Hue in degrees, wrapped to the 0-360 range |
| [in] | alpha | Alpha channel value (default 1.0) |
Definition at line 129 of file OkLab.cppm.
|
inlinenodiscardconstexprnoexcept |
Get the chroma, the distance from gray.
Definition at line 145 of file OkLab.cppm.
|
inlinenodiscardconstexprnoexcept |
Get the hue angle in the 0-360 range.
Definition at line 151 of file OkLab.cppm.
|
inlinenodiscardconstexprnoexcept |
Get the perceived lightness, 1 being D65 white.
Definition at line 139 of file OkLab.cppm.
|
staticconstexpr |
Color space name, used by the std::formatter specialization.
Definition at line 114 of file OkLab.cppm.