class Color

A class that represents a RGB or HSL color.

Global Functions

Color Blend (const Color, const Color, float)Interpolates between two colors based on the given float and returns the result as a new color.
Color FromHSL (const float, const float, const float)Constructs and returns a HSL color.

Constructors

Color ()Constructs a default color object.
Color (const Color)Constructs a new color as a copy of the given color.
Color (const int, const int, const int)Constructs a RGB color.

Methods

Gamma (float)Applies a gamma value on the color.
Invert ()Inverts the color.

Properties

int Blue ()Returns the color's blue channel value.
Blue (const int)Sets the color's blue channel value.
int Green ()Returns the color's green channel value.
Green (const int)Sets the color's green channel value.
float Hue ()Returns the color's hue value in degrees.
Hue (const float)Sets the color's hue value.
float Luminance ()Returns the color's luminance value.
Luminance (const float)Sets the color's luminance value.
int Red ()Returns the color's red channel value.
Red (const int)Sets the color's red channel value.
float Saturation ()Returns the color's saturation value.
Saturation (const float)Sets the color's saturation value.

Reference

function Color Blend (const Color s, const Color d, float a)

Interpolates between two colors based on the given float and returns the result as a new color.

The float value should be range 0.0 ~ 1.0.


function Color FromHSL (const float hue, const float sat, const float lum)

Constructs and returns a HSL color.


method Color ()

Constructs a default color object.


method Color (const Color src)

Constructs a new color as a copy of the given color.


method Color (const int r, const int g, const int b)

Constructs a RGB color.


method Gamma (float g)

Applies a gamma value on the color.


method Invert ()

Inverts the color.


accessor int Blue ()

Returns the color's blue channel value.


accessor Blue (const int)

Sets the color's blue channel value.

The value should be in range 0 ~ 255.


accessor int Green ()

Returns the color's green channel value.


accessor Green (const int)

Sets the color's green channel value.

The value should be in range 0 ~ 255.


accessor float Hue ()

Returns the color's hue value in degrees.


accessor Hue (const float)

Sets the color's hue value.


accessor float Luminance ()

Returns the color's luminance value.

A luminance of 0.0 results in black, 1.0 in white, 0.5 in full color saturation.


accessor Luminance (const float)

Sets the color's luminance value.


accessor int Red ()

Returns the color's red channel value.


accessor Red (const int)

Sets the color's red channel value.

The value should be in range 0 ~ 255.


accessor float Saturation ()

Returns the color's saturation value.

A saturation of 0.0 results in no color at all (gray), 1.0 in full color saturation.


accessor Saturation (const float)

Sets the color's saturation value.