MathLib
Loading...
Searching...
No Matches
Classes | Functions
Color Namespace Reference

Classes

class  BasicHSL
 
class  BasicHSV
 
class  BasicHue
 
class  BasicRGB
 
class  BasicUnitRGB
 

Typedefs

Hue

Various Hue class type aliases

See also
BasicHue
using Huef = BasicHue< float >
 
using Hued = BasicHue< double >
 
using Hue = BasicHue< double >
 
using Huel = BasicHue< long double >
 
RGB

Various RGB class type aliases

See also
BasicRGB
using RGBb = BasicRGB< uint8_t >
 
using RGBs = BasicRGB< unsigned short >
 
using RGBi = BasicRGB< unsigned int >
 
using UnitRGBf = BasicUnitRGB< float >
 
using UnitRGBd = BasicUnitRGB< double >
 
using UnitRGB = BasicUnitRGB< double >
 
using UnitRGBl = BasicUnitRGB< long double >
 
using RGB8 = BasicRGB< uint8_t >
 
using RGB16 = BasicRGB< unsigned short >
 
using RGB32 = BasicRGB< unsigned int >
 
HSV

Various HSV class type aliases

using HSVf = BasicHSV< float >
 
using HSVd = BasicHSV< double >
 
using HSV = BasicHSV< double >
 
using HSVld = BasicHSV< long double >
 
HSL

Various HSL class type aliases

using HSLf = BasicHSL< float >
 
using HSLd = BasicHSL< double >
 
using HSL = BasicHSL< double >
 
using HSLl = BasicHSL< long double >
 

Functions

template<std::floating_point T>
BasicHSV< T > ToHSV (const BasicUnitRGB< T > &input)
 
template<std::floating_point T>
BasicUnitRGB< T > ToRGB (const BasicHSV< T > &input_hsv)
 
template<std::floating_point T>
BasicHSL< T > ToHSL (const BasicHSV< T > &input_hsv)
 
template<std::floating_point T>
BasicHSV< T > ToHSV (const BasicHSL< T > &input_hsl)
 
template<std::floating_point T>
Math::BasicVector3D< T > palette (T t, Math::BasicVector3D< T > a, Math::BasicVector3D< T > b, Math::BasicVector3D< T > c, Math::BasicVector3D< T > d)
 

Typedef Documentation

◆ HSL

Definition at line 1258 of file Types.hpp.

◆ HSLd

Definition at line 1257 of file Types.hpp.

◆ HSLf

Definition at line 1256 of file Types.hpp.

◆ HSLl

Definition at line 1259 of file Types.hpp.

◆ HSV

Definition at line 1246 of file Types.hpp.

◆ HSVd

Definition at line 1245 of file Types.hpp.

◆ HSVf

Definition at line 1244 of file Types.hpp.

◆ HSVld

Definition at line 1247 of file Types.hpp.

Function Documentation

◆ palette()

template<std::floating_point T>
Math::BasicVector3D< T > palette ( T  t,
Math::BasicVector3D< T >  a,
Math::BasicVector3D< T >  b,
Math::BasicVector3D< T >  c,
Math::BasicVector3D< T >  d 
)

Generate a continuous color gradient

Parameters
t
a
b
c
d
Returns
vec3
Note
Borrowed from: https://iquilezles.org/articles/palettes/

Definition at line 30 of file Palette.hpp.

◆ ToHSL()

template<std::floating_point T>
BasicHSL< T > ToHSL ( const BasicHSV< T > &  input_hsv)

Converts a HSV color to a HSL color

Template Parameters
TA floating point type
Parameters
inputA BasicHSV color to convert
Returns
The color represented as a BasicHSL

Definition at line 211 of file Conversions.hpp.

◆ ToHSV() [1/2]

template<std::floating_point T>
BasicHSV< T > ToHSV ( const BasicHSL< T > &  input_hsl)

Converts a HSL color to a HSV color

Template Parameters
TA floating point type
Parameters
inputA BasicHSL color to convert
Returns
The color represented as a BasicHSV

Definition at line 236 of file Conversions.hpp.

◆ ToHSV() [2/2]

template<std::floating_point T>
BasicHSV< T > ToHSV ( const BasicUnitRGB< T > &  input)

Converts a normalized RGB color to HSV

Template Parameters
TA floating point type
Parameters
inputA BasicUnitRGB color to convert
Returns
The color represented as a BasicHSV

Definition at line 33 of file Conversions.hpp.

◆ ToRGB()

template<std::floating_point T>
BasicUnitRGB< T > ToRGB ( const BasicHSV< T > &  input_hsv)

Converts a HSV color to a unit RGB color

Template Parameters
TA floating point type
Parameters
inputA BasicHSV color to convert
Returns
The color represented as a BasicUnitRGB

Definition at line 112 of file Conversions.hpp.