|
aest 0.1.0
Collection of C++ utility libraries
|
Base class for color representations. More...
Public Member Functions | |
Observers | |
| 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. | |
Modifiers | |
| constexpr Derived | opacity (const float alpha) const |
| Returns a new color with the same channels and the specified alpha value. | |
Public Attributes | |
| friend | Derived |
| Lets the derived color reach the private constructor and channels. | |
Private Member Functions | |
| constexpr | ColorBase (const float alpha, const float channel1, const float channel2, const float channel3) |
| Construct a color from raw channel values. | |
Private Attributes | |
| float | _a |
| Alpha channel value in the 0-1 range. | |
| float | _ch1 |
| First channel value. | |
| float | _ch2 |
| Second channel value. | |
| float | _ch3 |
| Third channel value. | |
Friends | |
Identity operators | |
| constexpr bool | operator== (const Derived color1, const Derived color2) |
| Compare two colors of same type by checking each channel for equality. | |
Base class for color representations.
| Derived | The derived color class |
Definition at line 140 of file Color.cppm.
|
inlineexplicitconstexprprivate |
Construct a color from raw channel values.
| [in] | alpha | Alpha channel value, clamped to the 0-1 range |
| [in] | channel1 | First channel value, stored as is |
| [in] | channel2 | Second channel value, stored as is |
| [in] | channel3 | Third channel value, stored as is |
Definition at line 158 of file Color.cppm.
|
inlinenodiscardconstexprnoexcept |
Get the alpha channel value in the 0-1 range.
Definition at line 175 of file Color.cppm.
|
inlinenodiscardconstexprnoexcept |
Get the first channel value.
Definition at line 183 of file Color.cppm.
|
inlinenodiscardconstexprnoexcept |
Get the second channel value.
Definition at line 191 of file Color.cppm.
|
inlinenodiscardconstexprnoexcept |
Get the third channel value.
Definition at line 199 of file Color.cppm.
|
inlinenodiscardconstexpr |
Returns a new color with the same channels and the specified alpha value.
| [in] | alpha | The new alpha value for the returned color, in the 0-1 range. |
Definition at line 209 of file Color.cppm.
Compare two colors of same type by checking each channel for equality.
| [in] | color1 | First color |
| [in] | color2 | Second color |
true if all channels have the same value, false otherwise. Definition at line 223 of file Color.cppm.
|
private |
Alpha channel value in the 0-1 range.
Definition at line 146 of file Color.cppm.
|
private |
First channel value.
Definition at line 147 of file Color.cppm.
|
private |
Second channel value.
Definition at line 148 of file Color.cppm.
|
private |
Third channel value.
Definition at line 149 of file Color.cppm.
| friend aest::colors::ColorBase< Derived >::Derived |
Lets the derived color reach the private constructor and channels.
Definition at line 143 of file Color.cppm.