Skip to content

HSLColor

Utility class for managing a HSL color. More...

#include "Utils/HSLColor.h"

Public Functions

Name
HSLColorfromHSL(float * hsl)
HSLColorfromHSL(float hue, float saturation, float lightness)
HSLColorfromRGB(float * rgb)
HSLColorfromRGB(float red, float green, float blue)
HSLColordarken(float factor)<br>Creates a darker color.
HSLColordesaturate(float factor)
std::array< float, 3 >getHSL() const
floatgetHue() const
floatgetLightness() const
std::array< float, 3 >getRGB() const
floatgetSaturation() const
HSLColorlighten(float factor)<br>Creates a lighter color.
HSLColormakeComplementary()
HSLColorsaturate(float factor)
HSLColorsetHue(float mHue)
HSLColorsetLightness(float mLightness)
HSLColorsetSaturation(float mSaturation)
HSLColorshiftHue(float offset)

Detailed Description

cpp
class HSLColor;
class HSLColor;

Utility class for managing a HSL color.

Inspired by https://tips4java.wordpress.com/2009/07/05/hsl-color/

Public Functions Documentation

function fromHSL

cpp
static HSLColor fromHSL(
    float * hsl
)
static HSLColor fromHSL(
    float * hsl
)

function fromHSL

cpp
static HSLColor fromHSL(
    float hue,
    float saturation,
    float lightness
)
static HSLColor fromHSL(
    float hue,
    float saturation,
    float lightness
)

function fromRGB

cpp
static HSLColor fromRGB(
    float * rgb
)
static HSLColor fromRGB(
    float * rgb
)

function fromRGB

cpp
static HSLColor fromRGB(
    float red,
    float green,
    float blue
)
static HSLColor fromRGB(
    float red,
    float green,
    float blue
)

function darken

cpp
HSLColor darken(
    float factor
)
HSLColor darken(
    float factor
)

Creates a darker color.

function desaturate

cpp
HSLColor desaturate(
    float factor
)
HSLColor desaturate(
    float factor
)

function getHSL

cpp
std::array< float, 3 > getHSL() const
std::array< float, 3 > getHSL() const

function getHue

cpp
float getHue() const
float getHue() const

function getLightness

cpp
float getLightness() const
float getLightness() const

function getRGB

cpp
std::array< float, 3 > getRGB() const
std::array< float, 3 > getRGB() const

function getSaturation

cpp
float getSaturation() const
float getSaturation() const

function lighten

cpp
HSLColor lighten(
    float factor
)
HSLColor lighten(
    float factor
)

Creates a lighter color.

function makeComplementary

cpp
HSLColor makeComplementary()
HSLColor makeComplementary()

function saturate

cpp
HSLColor saturate(
    float factor
)
HSLColor saturate(
    float factor
)

function setHue

cpp
HSLColor setHue(
    float mHue
)
HSLColor setHue(
    float mHue
)

function setLightness

cpp
HSLColor setLightness(
    float mLightness
)
HSLColor setLightness(
    float mLightness
)

function setSaturation

cpp
HSLColor setSaturation(
    float mSaturation
)
HSLColor setSaturation(
    float mSaturation
)

function shiftHue

cpp
HSLColor shiftHue(
    float offset
)
HSLColor shiftHue(
    float offset
)

Updated on 2024-11-06 at 20:16:53 +0000