|
aest 0.1.0
Collection of C++ utility libraries
|
A color in OKLab, the perceptual space by Björn Ottosson. More...
Public Member Functions | |
| constexpr | OKLab () |
| Default constructor initializes the color to opaque black (0, 0, 0, 1). | |
| constexpr | OKLab (const float l, const float a, const float b, const float alpha=1.0f) |
| Construct a color from OKLab values and alpha. | |
Color Channels | |
| constexpr float | lightness () const noexcept |
| Get the perceived lightness, 1 being D65 white. | |
| constexpr float | a () const noexcept |
| Get the green-red axis, negative toward green. | |
| constexpr float | b () const noexcept |
| Get the blue-yellow axis, negative toward blue. | |
| Public Member Functions inherited from aest::colors::ColorBase< OKLab > | |
| 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 OKLab | 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 = "OKLab" |
| Color space name, used by the std::formatter specialization. | |
Additional Inherited Members | |
| Public Attributes inherited from aest::colors::ColorBase< OKLab > | |
| friend | Derived |
| Lets the derived color reach the private constructor and channels. | |
A color in OKLab, the perceptual space by Björn Ottosson.
L is the perceived lightness, 0 for black and 1 for the D65 white; a runs from green to red and b from blue to yellow, both 0 for grays. Equal distances look about equally different, which makes OKLab the space for color differences and for gradients that keep their lightness even. Channels are not clamped: HDR colors have L above 1, and colors outside any display's gamut are valid until converted to it.
Definition at line 55 of file OkLab.cppm.
|
inlineconstexpr |
Default constructor initializes the color to opaque black (0, 0, 0, 1).
Definition at line 62 of file OkLab.cppm.
|
inlineconstexpr |
Construct a color from OKLab values and alpha.
| [in] | l | Perceived lightness, 1 being D65 white |
| [in] | a | Green-red axis |
| [in] | b | Blue-yellow axis |
| [in] | alpha | Alpha channel value (default 1.0) |
Definition at line 74 of file OkLab.cppm.
|
inlinenodiscardconstexprnoexcept |
Get the green-red axis, negative toward green.
Definition at line 90 of file OkLab.cppm.
|
inlinenodiscardconstexprnoexcept |
Get the blue-yellow axis, negative toward blue.
Definition at line 96 of file OkLab.cppm.
|
inlinenodiscardconstexprnoexcept |
Get the perceived lightness, 1 being D65 white.
Definition at line 84 of file OkLab.cppm.
|
staticconstexpr |
Color space name, used by the std::formatter specialization.
Definition at line 59 of file OkLab.cppm.