Table of Contents

Class Hsl

Namespace
Dynamicweb.Imaging.Colors
Assembly
Dynamicweb.Core.dll

Representation of HSL color space

public class Hsl
Inheritance
Hsl
Inherited Members

Constructors

Hsl(Color)

Initializes a new instance of the Hsl class.

public Hsl(Color color)

Parameters

color Color

The color.

Hsl(float, double, double)

Initializes a new instance of the Hsl class.

public Hsl(float hue, double saturation, double value)

Parameters

hue float

The hue.

saturation double

The saturation.

value double

The value.

Properties

Color

Gets the color.

public Color Color { get; set; }

Property Value

Color

The color.

Hue

Gets the hue in degrees of the hsl color representation. 0-360

public double Hue { get; }

Property Value

double

The hue. 0-360

Lightness

Gets the value index of the hsl color representation. 0-1

public double Lightness { get; }

Property Value

double

The value. 0-1

Saturation

Gets the saturation index of the hsl color representation. 0-1

public double Saturation { get; }

Property Value

double

The saturation. 0-1

Methods

ColorFromHsl(double, double, double)

Colors from HSL.

public static Color ColorFromHsl(double h, double s, double l)

Parameters

h double

The hue, 0-360.

s double

The saturation, 0-1.

l double

The lightness, 0-1.

Returns

Color

ColorToHsl(Color)

Converts a color to HSL.

public void ColorToHsl(Color color)

Parameters

color Color

The color.

GetVariation(double, double)

Gets a variation over the current color with the specified saturation and value.

public Color GetVariation(double saturation, double lightness)

Parameters

saturation double

The saturation.

lightness double

The lightness.

Returns

Color

GetVariationByHue(float)

Gets a variation over the current color with the specified hue.

public Color GetVariationByHue(float hue)

Parameters

hue float

The hue.

Returns

Color

GetVariationBySaturation(double)

Gets a variation over the current color with the specified saturation.

public Color GetVariationBySaturation(double saturation)

Parameters

saturation double

The saturation.

Returns

Color

GetVariationByValue(double)

Gets a variation over the current color with the specified lightness.

public Color GetVariationByValue(double lightness)

Parameters

lightness double

The lightness.

Returns

Color
To top