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

Lab color space representation (CIE L*a*b*) More...

#include <colors.h>

Public Member Functions

 Lab ()
 Default constructor initializes Lab to black (0,0,0)
 
 Lab (const double l, const double a, const double b)
 Construct Lab from component values.
 
 Lab (const RGB &rgb)
 Construct Lab from RGB color.
 
 Lab (const HSL &hsl)
 Construct Lab from HSL color.
 
 Lab (const XYZ &xyz, const std::array< double, 3 > &white_point={ 0.95047, 1, 1.08883 })
 Construct Lab from XYZ color.
 
 Lab (const LCHab &lch)
 Construct Lab from LCHab color.
 
bool operator== (const Lab &other) const
 Equality operator for Lab colors.
 
double l () const
 Get lightness [0,100].
 
double a () const
 Get green-red component.
 
double b () const
 Get blue-yellow component.
 

Detailed Description

Lab color space representation (CIE L*a*b*)

Perceptually uniform color space where Euclidean distance approximates perceived color difference.

  • L: lightness (0 = black, 100 = white)
  • a: green-red axis (negative = green, positive = red)
  • b: blue-yellow axis (negative = blue, positive = yellow)

Definition at line 438 of file colors.h.

Constructor & Destructor Documentation

◆ Lab() [1/5]

qualpal::colors::Lab::Lab ( const double  l,
const double  a,
const double  b 
)

Construct Lab from component values.

Parameters
lLightness [0,100]
aGreen-red axis [-128,127]
bBlue-yellow axis [-128,127]

◆ Lab() [2/5]

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

Construct Lab from RGB color.

Parameters
rgbRGB color to convert from

◆ Lab() [3/5]

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

Construct Lab from HSL color.

Parameters
hslHSL color to convert from

◆ Lab() [4/5]

qualpal::colors::Lab::Lab ( const XYZ xyz,
const std::array< double, 3 > &  white_point = { 0.95047, 1, 1.08883 } 
)

Construct Lab from XYZ color.

Parameters
xyzXYZ color to convert from
white_pointReference white point (default: D65)

◆ Lab() [5/5]

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

Construct Lab from LCHab color.

Parameters
lchLCHab color to convert from

Member Function Documentation

◆ a()

double qualpal::colors::Lab::a ( ) const
inline

Get green-red component.

Definition at line 499 of file colors.h.

◆ b()

double qualpal::colors::Lab::b ( ) const
inline

Get blue-yellow component.

Definition at line 501 of file colors.h.

◆ l()

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

Get lightness [0,100].

Definition at line 497 of file colors.h.

◆ operator==()

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

Equality operator for Lab colors.

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

Definition at line 490 of file colors.h.


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