aest 0.1.0
Collection of C++ utility libraries
Loading...
Searching...
No Matches
aest::colors::Interpolation< OKLCH > Struct Reference

Interpolation of OKLCH: the hue along an arc of the hue circle, lightness, chroma and alpha linearly, like CSS color-mix(in oklch, …). More...

Static Public Member Functions

static constexpr OKLCH lerp (const OKLCH &from, const OKLCH &to, const float amount, const HueMode mode)
 Interpolates two colors, the hue along the arc mode picks.
static constexpr OKLCH lerp (const OKLCH &from, const OKLCH &to, const float amount)
 Interpolates two colors, the hue along the shorter arc.

Detailed Description

Interpolation of OKLCH: the hue along an arc of the hue circle, lightness, chroma and alpha linearly, like CSS color-mix(in oklch, …).

Definition at line 880 of file Operations.cppm.

Member Function Documentation

◆ lerp() [1/2]

constexpr OKLCH aest::colors::Interpolation< OKLCH >::lerp ( const OKLCH & from,
const OKLCH & to,
const float amount )
inlinestaticconstexpr

Interpolates two colors, the hue along the shorter arc.

Parameters
[in]fromThe color at amount 0
[in]toThe color at amount 1
[in]amountPosition between the two colors, in the 0-1 range
Returns
The interpolated color.

Definition at line 913 of file Operations.cppm.

◆ lerp() [2/2]

constexpr OKLCH aest::colors::Interpolation< OKLCH >::lerp ( const OKLCH & from,
const OKLCH & to,
const float amount,
const HueMode mode )
inlinestaticconstexpr

Interpolates two colors, the hue along the arc mode picks.

A color with chroma below ACHROMATIC_CHROMA is gray, and takes the hue of the other.

Parameters
[in]fromThe color at amount 0
[in]toThe color at amount 1
[in]amountPosition between the two colors, in the 0-1 range
[in]modeThe arc of the hue circle to follow
Returns
The interpolated color.

Definition at line 894 of file Operations.cppm.


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