qualpal 2.3.0
Loading...
Searching...
No Matches
qualpal::colors::HSL Class Reference

HSL (Hue, Saturation, Lightness) color representation. More...

#include <colors.h>

Public Member Functions

 HSL ()
 Default constructor initializes HSL to black (0,0,0)
 
 HSL (const double h, const double s, const double l)
 Construct HSL from component values.
 
 HSL (const RGB &rgb)
 Construct HSL from RGB color.
 
 HSL (const XYZ &xyz)
 Construct HSL from XYZ color.
 
 HSL (const Lab &lab)
 Construct HSL from Lab color.
 
 HSL (const LCHab &lch)
 Construct HSL from LCHab color.
 
bool operator== (const HSL &other) const
 Equality operator for HSL colors.
 
bool operator!= (const HSL &other) const
 Inequality operator for HSL colors.
 
double h () const
 Get hue in degrees [0,360)
 
double s () const
 Get saturation [0,1].
 
double l () const
 Get lightness [0,1].
 

Detailed Description

HSL (Hue, Saturation, Lightness) color representation.

HSL color space with hue in degrees [0,360), saturation and lightness in [0,1]. Provides intuitive color manipulation and conversion to/from RGB.

HSL orange(30, 1.0, 0.5); // Pure orange
HSL gray(0, 0.0, 0.5); // Medium gray
HSL (Hue, Saturation, Lightness) color representation.
Definition colors.h:195

Definition at line 194 of file colors.h.

Constructor & Destructor Documentation

◆ HSL() [1/5]

qualpal::colors::HSL::HSL ( const double  h,
const double  s,
const double  l 
)

Construct HSL from component values.

Parameters
hHue in degrees [0,360)
sSaturation [0,1]
lLightness [0,1]

◆ HSL() [2/5]

qualpal::colors::HSL::HSL ( const RGB rgb)

Construct HSL from RGB color.

Parameters
rgbRGB color to convert from

◆ HSL() [3/5]

qualpal::colors::HSL::HSL ( const XYZ xyz)

Construct HSL from XYZ color.

Parameters
xyzXYZ color to convert from

◆ HSL() [4/5]

qualpal::colors::HSL::HSL ( const Lab lab)

Construct HSL from Lab color.

Parameters
labLab color to convert from

◆ HSL() [5/5]

qualpal::colors::HSL::HSL ( const LCHab lch)

Construct HSL from LCHab color.

Parameters
lchLCHab color to convert from

Member Function Documentation

◆ h()

double qualpal::colors::HSL::h ( ) const
inline

Get hue in degrees [0,360)

Definition at line 258 of file colors.h.

◆ l()

double qualpal::colors::HSL::l ( ) const
inline

Get lightness [0,1].

Definition at line 262 of file colors.h.

◆ operator!=()

bool qualpal::colors::HSL::operator!= ( const HSL other) const
inline

Inequality operator for HSL colors.

Parameters
otherOther HSL color to compare with
Returns
true if HSL colors are not equal, false otherwise

Definition at line 255 of file colors.h.

◆ operator==()

bool qualpal::colors::HSL::operator== ( const HSL other) const
inline

Equality operator for HSL colors.

Parameters
otherOther HSL color to compare with
Returns
true if both HSL colors are equal, false otherwise

Definition at line 244 of file colors.h.

◆ s()

double qualpal::colors::HSL::s ( ) const
inline

Get saturation [0,1].

Definition at line 260 of file colors.h.


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