sincerely
Singaporean
If you have not done so, read this full tutorial on how to use SGEXTN to build an application.
class SGXColourHSLA;
part of SGEXTN module SG_Core
HSLA (hue saturation lightness) colour
list of all including inherited members
preprocessor file inclusion directive: #include ‹SGXColourHSLA.h›
CMake target for BuildLah: SGEXTN::SG_Core
see this link for more information about BuildLah
parent class: (none)
children classes: (none)
float a;
float h;
float l;
float s;
SGXColourHSLA(SGXColourRGBA x);
SGXColourHSLA(float h, float s, float l, float a);
[[nodiscard]] SGXColourRGBA getColourWithContrast(float c) const;
[[nodiscard]] int hash() const;
SGXColourHSLA& invertLightness();
SGXColourHSLA& invertSaturation();
SGXColourHSLA& linearTransformLightness(float m, float c);
SGXColourHSLA& linearTransformSaturation(float m, float c);
SGXColourHSLA& linearTransformTransparency(float m, float c);
SGXColourHSLA& offsetHue(float c);
[[nodiscard]] bool operator!=(SGXColourHSLA x) const;
[[nodiscard]] bool operator‹(SGXColourHSLA x) const;
[[nodiscard]] bool operator==(SGXColourHSLA x) const;
[[nodiscard]] bool operator›(SGXColourHSLA x) const;
SGXColourHSLA& setHue(float h);
SGXColourHSLA& setLightness(float l);
SGXColourHSLA& setSaturation(float s);
SGXColourHSLA& setTransparency(float a);
[[nodiscard]] SGXColourRGBA toRGBA() const;
SGXColourHSLA represents a colour in HSLA format with effectively infinite precision as it uses floating point numbers internally. The hue can range from 0 to 360 inclusive and the saturation, lightness, and transparency can range from 0 to 100 inclusive. SGXColourHSLA is only intended for precise colour mixing, it must be convert to SGXColourRGBA for output. Note that a colour with full lightness is always white, HSL is NOT the same as HSV.
SGXColourHSLA stores the hue, saturation, lightness, and transparency channels in 4 floating point numbers.
Transparency of the SGXColourHSLA.
Setting this to a value below 0 or above 100 is undefined behaviour.
Hue of the SGXColourHSLA.
Setting this to a value below 0 or above 360 is undefined behaviour.
Lightness of the SGXColourHSLA.
Setting this to a value below 0 or above 100 is undefined behaviour.
Saturation of the SGXColourHSLA
Setting this to a value below 0 or above 100 is undefined behaviour.
Creates a SGXColourHSLA from the SGXColourRGBA x.
Creates a SGXColourHSLA with hue h, saturation s, lightness l, and transparency a.
If any argument is out of bounds, the constructor corrects it automatically.
Returns a SGXColourRGBA with the same hue and saturation as this SGXColourHSLA and its SGXColourRGBA::relativeContrast being c.
Hash function defined for SGLLesserThan and SGLMoreThan.
Inverts the hue of this SGXColourHSLA and returns a reference to this SGXColourHSLA to allow operation chaining.
Inverts the lightness of this SGXColourHSLA and returns a reference to this SGXColourHSLA to allow operation chaining.
This can be used to change between light mode and dark mode for custom UI.
Inverts the saturation of this SGXColourHSLA and returns a reference to this SGXColourHSLA to allow operation chaining.
Replaces the lightness of this SGXColourHSLA with m * lightness + c and returns a reference to this SGXColourHSLA to allow operation chaining.
If the new lightness is out of bounds, it is corrected automatically.
Replaces the saturation of this SGXColourHSLA with m * saturation + c and returns a reference to this SGXColourHSLA to allow operation chaining.
If the new saturation is out of bounds, it is corrected automatically.
Replaces the transparency of this SGXColourHSLA with m * transparency + c and returns a reference to this SGXColourHSLA to allow operation chaining.
If the new transparency is out of bounds, it is corrected automatically.
Replaces the hue of this SGXColourHSLA with hue + c and returns a reference to this SGXColourHSLA to allow operation chaining.
If the new hue is out of bounds, it is corrected automatically.
Inequality check with x defined for SGLEqualsTo.
Lesser than operator with x defined for SGLLesserThan and SGLMoreThan.
Equality check with x defined for SGLEqualsTo.
More than operator with x defined for SGLLesserThan and SGLMoreThan.
Sets the hue of this SGXColourHSLA to h and returns a reference to this SGXColourHSLA to allow operation chaining.
If h is out of bounds, it is corrected automatically.
Sets the lightness of this SGXColourHSLA to l and returns a reference to this SGXColourHSLA to allow operation chaining.
If l is out of bounds, it is corrected automatically.
Sets the saturation of this SGXColourHSLA to s and returns a reference to this SGXColourHSLA to allow operation chaining.
If s is out of bounds, it is corrected automatically.
Sets the transparency of this SGXColourHSLA to a and returns a reference to this SGXColourHSLA to allow operation chaining.
If a is out of bounds, it is corrected automatically.
Returns this SGXColourHSLA converted to a SGXColourRGBA.
This is necessary to use the colour for display.
©2025 05524F.sg (Singapore)