# qualpal::colors::LCHab

C++ · 4.1.0

[Source](<https://github.com/jolars/qualpal/blob/887b793a3795d298a62e49356a72314ce59dab0d/include/qualpal/colors.h>)

```cpp
class qualpal::colors::LCHab
```

[LCHab](<40196941d3c803da97771dc26834b49dfe5163d017a78d7bdc8fdf4ca5952eb2>) color space representation (CIE L\*C\*h). 

[LCHab](<40196941d3c803da97771dc26834b49dfe5163d017a78d7bdc8fdf4ca5952eb2>) color space representation (CIE L\*C\*h).

Cylindrical representation of [Lab](<bc5685852e488d86b4707de1ef1d606b788c0f89d090ec8c4cf03d84d1a6defd>) color space:

- L: Lightness \[0, 100\]
- C: Chroma \[0, ∞)
- H: Hue in degrees \[0, 360)

Useful for intuitive manipulation of color lightness, chroma, and hue. Provides conversion constructors for [Lab](<bc5685852e488d86b4707de1ef1d606b788c0f89d090ec8c4cf03d84d1a6defd>), [RGB](<1a9e7400df83ac8262249ade4a2c007375c2d75db6ae37e8f78ca450266e8411>), [HSL](<f36bc23dbb1e50e6765c182aec07a7cf7cd3d62e21fe43426fa3b6afb27490d0>), and [XYZ](<4d1887fdbe70c609fc0a10099309f48798368a21d082afcf2ea7968852b3bc87>). Most conversions use the D65 reference white point by default.

<a id="documentation-see-also"></a>

### See also

[Lab](<bc5685852e488d86b4707de1ef1d606b788c0f89d090ec8c4cf03d84d1a6defd>), [RGB](<1a9e7400df83ac8262249ade4a2c007375c2d75db6ae37e8f78ca450266e8411>), [HSL](<f36bc23dbb1e50e6765c182aec07a7cf7cd3d62e21fe43426fa3b6afb27490d0>), [XYZ](<4d1887fdbe70c609fc0a10099309f48798368a21d082afcf2ea7968852b3bc87>) for conversions. 

<a id="cpp-methods"></a>

## Methods

<a id="cpp-5c8bb808a763ae3efd810df4dee77802363aef8183116a1230fc4e9b2023c745"></a>

### `LCHab`

<a id="cpp-c1c91bb2e694e14848f10646bd76b8d29a540d14327959e4203426ff3700ebaa"></a>

#### `LCHab`

```cpp
LCHab()
```

[Source](<https://github.com/jolars/qualpal/blob/887b793a3795d298a62e49356a72314ce59dab0d/include/qualpal/colors.h>)

Default constructor initializes [LCHab](<40196941d3c803da97771dc26834b49dfe5163d017a78d7bdc8fdf4ca5952eb2>) to black (0,0,0). 

<a id="cpp-da8174762f9dddbc660065ed527e900b6b236801b8e052111ec609d97dae9db0"></a>

#### `LCHab`

```cpp
LCHab(const HSL & hsl)
```

[Source](<https://github.com/jolars/qualpal/blob/887b793a3795d298a62e49356a72314ce59dab0d/include/qualpal/colors.h>)

Construct [LCHab](<40196941d3c803da97771dc26834b49dfe5163d017a78d7bdc8fdf4ca5952eb2>) from [HSL](<f36bc23dbb1e50e6765c182aec07a7cf7cd3d62e21fe43426fa3b6afb27490d0>) color. 

<a id="cpp-da8174762f9dddbc660065ed527e900b6b236801b8e052111ec609d97dae9db0-documentation-parameters"></a>

###### Parameters

**`hsl`**

[HSL](<f36bc23dbb1e50e6765c182aec07a7cf7cd3d62e21fe43426fa3b6afb27490d0>) color to convert from 

<a id="cpp-ae626bbdd191a99361b5823eb61eccafa5735b929d2c9f1cf89efa51a852232e"></a>

#### `LCHab`

```cpp
LCHab(const Lab & lab)
```

[Source](<https://github.com/jolars/qualpal/blob/887b793a3795d298a62e49356a72314ce59dab0d/include/qualpal/colors.h>)

Construct [LCHab](<40196941d3c803da97771dc26834b49dfe5163d017a78d7bdc8fdf4ca5952eb2>) from [Lab](<bc5685852e488d86b4707de1ef1d606b788c0f89d090ec8c4cf03d84d1a6defd>) color. 

<a id="cpp-ae626bbdd191a99361b5823eb61eccafa5735b929d2c9f1cf89efa51a852232e-documentation-parameters"></a>

###### Parameters

**`lab`**

[Lab](<bc5685852e488d86b4707de1ef1d606b788c0f89d090ec8c4cf03d84d1a6defd>) color to convert from 

<a id="cpp-4db24e6ec85c8c17bc140a0cdcad0897d1f32aa84c7feeb3733cb9ed8704b3e0"></a>

#### `LCHab`

```cpp
LCHab(const RGB & rgb)
```

[Source](<https://github.com/jolars/qualpal/blob/887b793a3795d298a62e49356a72314ce59dab0d/include/qualpal/colors.h>)

Construct [LCHab](<40196941d3c803da97771dc26834b49dfe5163d017a78d7bdc8fdf4ca5952eb2>) from [RGB](<1a9e7400df83ac8262249ade4a2c007375c2d75db6ae37e8f78ca450266e8411>) color. 

<a id="cpp-4db24e6ec85c8c17bc140a0cdcad0897d1f32aa84c7feeb3733cb9ed8704b3e0-documentation-parameters"></a>

###### Parameters

**`rgb`**

[RGB](<1a9e7400df83ac8262249ade4a2c007375c2d75db6ae37e8f78ca450266e8411>) color to convert from 

<a id="cpp-dbc13c5f6a024d604f1e4559644d26a8b80f17119e9636cce246cf79ed5fe253"></a>

#### `LCHab`

```cpp
LCHab(const XYZ & xyz, const std::array<double, 3> & white_point = { 0.95047, 1, 1.08883 })
```

[Source](<https://github.com/jolars/qualpal/blob/887b793a3795d298a62e49356a72314ce59dab0d/include/qualpal/colors.h>)

Construct [LCHab](<40196941d3c803da97771dc26834b49dfe5163d017a78d7bdc8fdf4ca5952eb2>) from [XYZ](<4d1887fdbe70c609fc0a10099309f48798368a21d082afcf2ea7968852b3bc87>) color. 

<a id="cpp-dbc13c5f6a024d604f1e4559644d26a8b80f17119e9636cce246cf79ed5fe253-documentation-parameters"></a>

###### Parameters

**`xyz`**

[XYZ](<4d1887fdbe70c609fc0a10099309f48798368a21d082afcf2ea7968852b3bc87>) color to convert from 

**`white_point`**

Reference white point (default: D65) 

<a id="cpp-64fba3043cc43a03d2439f350d9426686cef787cca855bc56f4177ae5e2a444b"></a>

#### `LCHab`

```cpp
LCHab(const double l, const double c, const double h)
```

[Source](<https://github.com/jolars/qualpal/blob/887b793a3795d298a62e49356a72314ce59dab0d/include/qualpal/colors.h>)

Construct [LCHab](<40196941d3c803da97771dc26834b49dfe5163d017a78d7bdc8fdf4ca5952eb2>) from component values. 

<a id="cpp-64fba3043cc43a03d2439f350d9426686cef787cca855bc56f4177ae5e2a444b-documentation-parameters"></a>

###### Parameters

**`l`**

Lightness \[0,100\] 

**`c`**

Chroma \[0,∞) 

**`h`**

Hue in degrees \[0,360) 

<a id="cpp-c29c5ed8ee7e91bafcb8253f268030b3b1c79556f293d096e3aa83ecae592cc6"></a>

### `c`

```cpp
inline double c() const
```

[Source](<https://github.com/jolars/qualpal/blob/887b793a3795d298a62e49356a72314ce59dab0d/include/qualpal/colors.h>)

Get chroma \[0,∞). 

<a id="cpp-3af043e4dc6aa00d58d6057b006984f8e9d844a5cd5dd19e913668fa9971bc25"></a>

### `h`

```cpp
inline double h() const
```

[Source](<https://github.com/jolars/qualpal/blob/887b793a3795d298a62e49356a72314ce59dab0d/include/qualpal/colors.h>)

Get hue in degrees \[0,360). 

<a id="cpp-de5582f2f8a7d875c3a5c8f4f12bbf401aaf1a705e7b03d2c4e3a0b64809dfd3"></a>

### `l`

```cpp
inline double l() const
```

[Source](<https://github.com/jolars/qualpal/blob/887b793a3795d298a62e49356a72314ce59dab0d/include/qualpal/colors.h>)

Get lightness \[0,100\]. 

<a id="cpp-f2761186f626df31bf62ccf9a66f064a27840d05e3d55ca1b32fec212394e9a0"></a>

### `operator!=`

```cpp
inline bool operator!=(const LCHab & other) const
```

[Source](<https://github.com/jolars/qualpal/blob/887b793a3795d298a62e49356a72314ce59dab0d/include/qualpal/colors.h>)

inequality operator for [LCHab](<40196941d3c803da97771dc26834b49dfe5163d017a78d7bdc8fdf4ca5952eb2>) colors 

<a id="cpp-f2761186f626df31bf62ccf9a66f064a27840d05e3d55ca1b32fec212394e9a0-documentation-parameters"></a>

##### Parameters

**`other`**

Other [LCHab](<40196941d3c803da97771dc26834b49dfe5163d017a78d7bdc8fdf4ca5952eb2>) color to compare with 

 

<a id="cpp-f2761186f626df31bf62ccf9a66f064a27840d05e3d55ca1b32fec212394e9a0-documentation-returns"></a>

##### Returns

true if [LCHab](<40196941d3c803da97771dc26834b49dfe5163d017a78d7bdc8fdf4ca5952eb2>) colors are not equal, false otherwise 

<a id="cpp-492fe1896a2ef248b208435e60e89ae4de0bff6cd2957b4a1a3af1724737315b"></a>

### `operator==`

```cpp
inline bool operator==(const LCHab & other) const
```

[Source](<https://github.com/jolars/qualpal/blob/887b793a3795d298a62e49356a72314ce59dab0d/include/qualpal/colors.h>)

equality operator for [LCHab](<40196941d3c803da97771dc26834b49dfe5163d017a78d7bdc8fdf4ca5952eb2>) colors 

<a id="cpp-492fe1896a2ef248b208435e60e89ae4de0bff6cd2957b4a1a3af1724737315b-documentation-parameters"></a>

##### Parameters

**`other`**

Other [LCHab](<40196941d3c803da97771dc26834b49dfe5163d017a78d7bdc8fdf4ca5952eb2>) color to compare with 

 

<a id="cpp-492fe1896a2ef248b208435e60e89ae4de0bff6cd2957b4a1a3af1724737315b-documentation-returns"></a>

##### Returns

true if both [LCHab](<40196941d3c803da97771dc26834b49dfe5163d017a78d7bdc8fdf4ca5952eb2>) colors are equal, false otherwise
