![]() |
NDEVR
API Documentation
|
A color defined by hue, saturation, and luminosity components. More...
Public Member Functions | |
| constexpr | HSLColor () |
| Constructs a default HSLColor with all components set to invalid. | |
| HSLColor (const ACIColor &) | |
| Constructs an HSLColor by converting from an ACIColor. | |
| constexpr | HSLColor (const Angle< HSLAngleType > &h, fltp04 s, fltp04 b, fltp04 a=1.0f) |
| Constructs an HSLColor from an angle and single-precision floating-point components. | |
| constexpr | HSLColor (const Angle< HSLAngleType > &h, fltp08 s, fltp08 b, fltp08 a=1.0) |
| Constructs an HSLColor from an angle and double-precision floating-point components. | |
| constexpr | HSLColor (const Angle< HSLAngleType > &h, uint01 s, uint01 b, uint01 a=255) |
| Constructs an HSLColor from an angle and integer components. | |
| constexpr | HSLColor (const HSLColor &color)=default |
| Copy constructor. | |
| HSLColor (const RGBColor &) | |
| Constructs an HSLColor by converting from an RGBColor. | |
| constexpr | HSLColor (const Vector< 4, fltp04 > &color) |
| Constructs an HSLColor from a 4-component float vector (hue degrees, saturation, brightness, alpha). | |
| HSLColor (const XYZColor &) | |
| Constructs an HSLColor by converting from an XYZColor. | |
| constexpr | HSLColor (fltp04 h, fltp04 s, fltp04 b, fltp04 a=1.0f) |
| Constructs an HSLColor from single-precision hue in degrees and normalized components. | |
| constexpr | HSLColor (fltp08 h, fltp08 s, fltp08 b, fltp08 a=1.0f) |
| Constructs an HSLColor from double-precision hue in degrees and normalized components. | |
| constexpr | HSLColor (uint01 h, uint01 s, uint01 b, uint01 a=255) |
| Constructs an HSLColor from integer components, converting hue from a 0-255 range to degrees. | |
| fltp04 | getAF () const |
| Gets the alpha component as a normalized float (0.0-1.0). | |
| fltp04 | getBF () const |
| Gets the brightness component as a normalized float (0.0-1.0). | |
| template<class t_type> | |
| t_type | getHDeg () const |
| Gets the hue component in degrees, converted to the specified type. | |
| uint01 | getHI () const |
| Gets the hue component as a uint01 index in the range 0-255. | |
| fltp04 | getSF () const |
| Gets the saturation component as a normalized float (0.0-1.0). | |
| bool | operator!= (const HSLColor &color) const |
| Checks inequality between two HSLColor values. | |
| bool | operator== (const HSLColor &color) const |
| Checks equality between two HSLColor values. | |
| template<class t_type> | |
| void | setHDeg (const t_type &val) |
| Sets the hue component from a value in degrees. | |
| void | setHI (uint01 val) |
| Sets the hue component from a uint01 index in the range 0-255. | |
Public Attributes | |
| uint01 | alpha |
| The alpha (opacity) component, stored as 0-255. | |
| uint01 | brightness |
| The brightness (luminosity) component, stored as 0-255. | |
| Angle< HSLAngleType > | hue |
| The hue component, representing the color angle on the color wheel. | |
| uint01 | saturation |
| The saturation component, stored as 0-255. | |
A color defined by hue, saturation, and luminosity components.
The HSL (Hue, Saturation, Luminosity) color model defines a color space in terms of three constituent components hue, brightness and luminosity
Definition at line 50 of file HSLColor.h.
|
constexprdefault |
|
inlineconstexpr |
Constructs an HSLColor from an angle and integer components.
| [in] | h | The hue as an Angle. |
| [in] | s | The saturation as a uint01 (0-255). |
| [in] | b | The brightness as a uint01 (0-255). |
| [in] | a | The alpha as a uint01 (0-255), defaults to 255 (fully opaque). |
Definition at line 79 of file HSLColor.h.
References alpha, brightness, hue, and saturation.
Constructs an HSLColor from integer components, converting hue from a 0-255 range to degrees.
| [in] | h | The hue as a uint01 (0-255), mapped to 0-360 degrees. |
| [in] | s | The saturation as a uint01 (0-255). |
| [in] | b | The brightness as a uint01 (0-255). |
| [in] | a | The alpha as a uint01 (0-255), defaults to 255 (fully opaque). |
Definition at line 92 of file HSLColor.h.
References alpha, brightness, cast(), DEGREES, hue, and saturation.
|
inlineconstexpr |
Constructs an HSLColor from an angle and double-precision floating-point components.
| [in] | h | The hue as an Angle. |
| [in] | s | The saturation as a normalized double (0.0-1.0). |
| [in] | b | The brightness as a normalized double (0.0-1.0). |
| [in] | a | The alpha as a normalized double (0.0-1.0), defaults to 1.0 (fully opaque). |
Definition at line 106 of file HSLColor.h.
References alpha, brightness, cast(), hue, and saturation.
|
inlineconstexpr |
Constructs an HSLColor from an angle and single-precision floating-point components.
| [in] | h | The hue as an Angle. |
| [in] | s | The saturation as a normalized float (0.0-1.0). |
| [in] | b | The brightness as a normalized float (0.0-1.0). |
| [in] | a | The alpha as a normalized float (0.0-1.0), defaults to 1.0 (fully opaque). |
Definition at line 120 of file HSLColor.h.
References alpha, brightness, cast(), hue, and saturation.
Constructs an HSLColor from double-precision hue in degrees and normalized components.
| [in] | h | The hue in degrees as a double. |
| [in] | s | The saturation as a normalized double (0.0-1.0). |
| [in] | b | The brightness as a normalized double (0.0-1.0). |
| [in] | a | The alpha as a normalized double (0.0-1.0), defaults to 1.0 (fully opaque). |
Definition at line 134 of file HSLColor.h.
References alpha, brightness, cast(), DEGREES, hue, and saturation.
Constructs an HSLColor from single-precision hue in degrees and normalized components.
| [in] | h | The hue in degrees as a float. |
| [in] | s | The saturation as a normalized float (0.0-1.0). |
| [in] | b | The brightness as a normalized float (0.0-1.0). |
| [in] | a | The alpha as a normalized float (0.0-1.0), defaults to 1.0 (fully opaque). |
Definition at line 148 of file HSLColor.h.
References alpha, brightness, cast(), DEGREES, hue, and saturation.
Constructs an HSLColor from a 4-component float vector (hue degrees, saturation, brightness, alpha).
| [in] | color | A vector where X=hue in degrees, Y=saturation (0-1), Z=brightness (0-1), W=alpha (0-1). |
Definition at line 158 of file HSLColor.h.
References alpha, brightness, cast(), DEGREES, hue, and saturation.
|
explicit |
|
explicit |
|
explicit |
|
inline |
Gets the alpha component as a normalized float (0.0-1.0).
Definition at line 235 of file HSLColor.h.
|
inline |
Gets the brightness component as a normalized float (0.0-1.0).
Definition at line 219 of file HSLColor.h.
References brightness, and cast().
|
inline |
Gets the hue component in degrees, converted to the specified type.
Definition at line 184 of file HSLColor.h.
|
inline |
Gets the hue component as a uint01 index in the range 0-255.
Definition at line 201 of file HSLColor.h.
References cast(), hue, and Angle< t_type >::INDEX_PI.
|
inline |
Gets the saturation component as a normalized float (0.0-1.0).
Definition at line 227 of file HSLColor.h.
References cast(), and saturation.
|
inline |
Checks inequality between two HSLColor values.
| [in] | color | The HSLColor to compare against. |
Definition at line 256 of file HSLColor.h.
References HSLColor(), alpha, brightness, hue, and saturation.
|
inline |
Checks equality between two HSLColor values.
| [in] | color | The HSLColor to compare against. |
Definition at line 244 of file HSLColor.h.
References HSLColor(), alpha, brightness, hue, and saturation.
|
inline |
Sets the hue component from a value in degrees.
| [in] | val | The hue value in degrees to set. |
Definition at line 193 of file HSLColor.h.
|
inline |
Sets the hue component from a uint01 index in the range 0-255.
| [in] | val | The hue as a 0-255 integer, mapped to the full angular range. |
Definition at line 210 of file HSLColor.h.
References hue, and Angle< t_type >::INDEX_PI.