|
aest 0.1.0
Collection of C++ utility libraries
|
A color as hue, saturation and lightness, over the encoded RGB space RGB.
More...
Public Member Functions | |
| constexpr | BasicHSL () |
| Default constructor initializes the color to opaque black (0, 0, 0, 1). | |
| constexpr | BasicHSL (const float h, const float s, const float l, const float a=1.0f) |
| Construct a color from floating-point HSLA values. | |
Color Channels | |
| constexpr float | hue () const noexcept |
| Get the hue value in the 0-360 range. | |
| constexpr float | saturation () const noexcept |
| Get the saturation value in the 0-1 range. | |
| constexpr float | lightness () const noexcept |
| Get the lightness value in the 0-1 range. | |
| Public Member Functions inherited from aest::colors::ColorBase< BasicHSL< RGB > > | |
| 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 BasicHSL< RGB > | 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 |
| Color space name, used by the std::formatter specialization. | |
Static Private Attributes | |
| static constexpr std::string_view | MODEL = "HSL" |
| Name of the model, the whole space name over SRGB. | |
| static constexpr auto | QUALIFIED_CHARS |
| The space name over another RGB space, HSL< + RGB::TYPE + >. | |
Additional Inherited Members | |
| Public Attributes inherited from aest::colors::ColorBase< BasicHSL< RGB > > | |
| friend | Derived |
| Lets the derived color reach the private constructor and channels. | |
A color as hue, saturation and lightness, over the encoded RGB space RGB.
HSL rearranges the channels of RGB, so it covers the same gamut: over DisplayP3 it reaches the P3 colors that HSL over SRGB clips. The hue is wrapped to the [0, 360) range; saturation and lightness are clamped to the 0-1 range. Convert to any other space with convert().
| RGB | The encoded RGB space, such as SRGB: its channels must be in the 0-1 range, so linear spaces are rejected. |
Definition at line 32 of file Cylindrical.cppm.
|
inlineconstexpr |
Default constructor initializes the color to opaque black (0, 0, 0, 1).
Definition at line 48 of file Cylindrical.cppm.
|
inlineconstexpr |
Construct a color from floating-point HSLA values.
| [in] | h | Hue in degrees, wrapped to the 0-360 range |
| [in] | s | Saturation value |
| [in] | l | Lightness value |
| [in] | a | Alpha channel value (default 1.0) |
Definition at line 60 of file Cylindrical.cppm.
|
inlinenodiscardconstexprnoexcept |
Get the hue value in the 0-360 range.
Definition at line 70 of file Cylindrical.cppm.
|
inlinenodiscardconstexprnoexcept |
Get the lightness value in the 0-1 range.
Definition at line 82 of file Cylindrical.cppm.
|
inlinenodiscardconstexprnoexcept |
Get the saturation value in the 0-1 range.
Definition at line 76 of file Cylindrical.cppm.
|
staticconstexprprivate |
Name of the model, the whole space name over SRGB.
Definition at line 35 of file Cylindrical.cppm.
|
staticconstexprprivate |
The space name over another RGB space, HSL< + RGB::TYPE + >.
Definition at line 38 of file Cylindrical.cppm.
|
staticconstexpr |
Color space name, used by the std::formatter specialization.
Definition at line 43 of file Cylindrical.cppm.