aest 0.1.0
Collection of C++ utility libraries
Loading...
Searching...
No Matches
aest::colors::CIELCH Class Referencefinalexport

A color in CIELCH: CIELab in polar form, as lightness, chroma and hue. More...

Inheritance diagram for aest::colors::CIELCH:
aest::colors::ColorBase< CIELCH >

Public Member Functions

constexpr CIELCH ()
 Default constructor initializes the color to opaque black (0, 0, 0, 1).
constexpr CIELCH (const float l, const float c, const float h, const float alpha=1.0f)
 Construct a color from CIELCH values and alpha.
Color Channels
constexpr float lightness () const noexcept
 Get the lightness, 100 being D50 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< CIELCH >
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 CIELCH 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 = "CIELCH"
 Color space name, used by the std::formatter specialization.

Additional Inherited Members

Public Attributes inherited from aest::colors::ColorBase< CIELCH >
friend Derived
 Lets the derived color reach the private constructor and channels.

Detailed Description

A color in CIELCH: CIELab in polar form, as lightness, chroma and hue.

The values match CSS lch(). 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.

See also
ISO/CIE 11664-4

Definition at line 124 of file CieLab.cppm.

Constructor & Destructor Documentation

◆ CIELCH() [1/2]

aest::colors::CIELCH::CIELCH ( )
inlineconstexpr

Default constructor initializes the color to opaque black (0, 0, 0, 1).

Definition at line 131 of file CieLab.cppm.

◆ CIELCH() [2/2]

aest::colors::CIELCH::CIELCH ( const float l,
const float c,
const float h,
const float alpha = 1.0f )
inlineconstexpr

Construct a color from CIELCH values and alpha.

Parameters
[in]lLightness, 100 being D50 white
[in]cChroma, clamped at 0
[in]hHue in degrees, wrapped to the 0-360 range
[in]alphaAlpha channel value (default 1.0)
Precondition
Every channel is finite: NaN and infinities are undefined behavior.

Definition at line 143 of file CieLab.cppm.

Member Function Documentation

◆ chroma()

float aest::colors::CIELCH::chroma ( ) const
inlinenodiscardconstexprnoexcept

Get the chroma, the distance from gray.

Returns
The chroma, 0 or greater

Definition at line 159 of file CieLab.cppm.

◆ hue()

float aest::colors::CIELCH::hue ( ) const
inlinenodiscardconstexprnoexcept

Get the hue angle in the 0-360 range.

Returns
The hue in degrees

Definition at line 165 of file CieLab.cppm.

◆ lightness()

float aest::colors::CIELCH::lightness ( ) const
inlinenodiscardconstexprnoexcept

Get the lightness, 100 being D50 white.

Returns
The L* channel

Definition at line 153 of file CieLab.cppm.

Member Data Documentation

◆ TYPE

std::string_view aest::colors::CIELCH::TYPE = "CIELCH"
staticconstexpr

Color space name, used by the std::formatter specialization.

Definition at line 128 of file CieLab.cppm.


The documentation for this class was generated from the following file: