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
colorColorThe color.
Hsl(float, double, double)
Initializes a new instance of the Hsl class.
public Hsl(float hue, double saturation, double value)
Parameters
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
Returns
ColorToHsl(Color)
Converts a color to HSL.
public void ColorToHsl(Color color)
Parameters
colorColorThe 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
Returns
GetVariationByHue(float)
Gets a variation over the current color with the specified hue.
public Color GetVariationByHue(float hue)
Parameters
huefloatThe hue.
Returns
GetVariationBySaturation(double)
Gets a variation over the current color with the specified saturation.
public Color GetVariationBySaturation(double saturation)
Parameters
saturationdoubleThe saturation.
Returns
GetVariationByValue(double)
Gets a variation over the current color with the specified lightness.
public Color GetVariationByValue(double lightness)
Parameters
lightnessdoubleThe lightness.