ColorHSL

The HSL color model describes a color by using the three color components hue (H), saturation (S) and luminance (L). This color format is very popular for designing and editing (e.g. within graphics design tools) because it gives the user a good impression about the resulting color for a certain color value: Hue defines the pure color tone out of the color spectrum, saturation defines the mixture of the color tone with gray and finally luminance defines the lightness of the resulting color.

Constructors

this
this()
this
this(double hue, double saturation, double luminance, double opacity = 0)

Create a Color from the specified doubles.

this
this(string color)

Create a Color from a X11 color specification string

Members

Functions

hue
void hue(double hue)
double hue()

The value for hue as a an angle between 0 and 360 degrees.

luminance
double luminance()

The value for the luminance as a double in the range [0.0 .. 1.0]

luminance
void luminance(double luminance)

The value for the luminance as a double in the range [0.0 .. 1.0]

saturation
void saturation(double saturation)
double saturation()

The value the saturation as a double in the range [0.0 .. 1.0]

Inherited Members

From Color

opEquals
bool opEquals(Object obj)
toString
string toString()

Returns the value as a hex string.

opCast
T opCast()

Support casting between different colors. You can also use std.conv.to

redQuantum
void redQuantum(Quantum red)
Quantum redQuantum()

The value for red in the range [0 .. QuantumRange]

greenQuantum
void greenQuantum(Quantum green)
Quantum greenQuantum()

The value for green in the range [0 .. QuantumRange]

blueQuantum
void blueQuantum(Quantum blue)
Quantum blueQuantum()

The value for blue in the range [0 .. QuantumRange]

opacityByte
void opacityByte(ubyte opacity)
ubyte opacityByte()

The opacity as a byte. [0 .. 255]

opacityQuantum
void opacityQuantum(Quantum opacity)
Quantum opacityQuantum()

The value for opacity in the range [0 .. QuantumRange]

opacity
void opacity(double opacity)
double opacity()

The value for opacity as a double in the range [0.0 .. 1.0]

intensity
double intensity()

The intensity of this color.

clone
Color clone()

Create a copy of this Color.

name
string name()

Returns the name of the color or the value as a hex string.

Meta