[]
Represents a color in HSL (hue, saturation, lightness) color model.
public struct HslColor : IEquatable<HslColor>
Initializes a new instance of the HslColor struct from a System.Drawing.Color value.
public HslColor(Color color)
color
System.Drawing.ColorInitializes a new instance of the HslColor struct from a 32-bit ARGB value.
public HslColor(int argb)
argb
intInitializes a new instance of the HslColor struct.
public HslColor(float hue, float saturation, float lightness, float opacity = 1)
hue
floatHue value in the range [0, 360].
saturation
floatSaturation value in the range [0, 1].
lightness
floatLightness value in the range [0, 1].
opacity
floatOpacity value in the range [0, 1].
Gets or sets the hue value in the range [0, 360].
public float Hue { get; set; }
Gets or sets the lightness value in the range [0, 1].
public float Lightness { get; set; }
Gets or sets the opacity value in the range [0, 1].
public float Opacity { get; set; }
Gets or sets the saturation value in the range [0, 1].
public float Saturation { get; set; }
Determines whether the specified HslColor is equal to this instance.
public bool Equals(HslColor other)
other
HslColorDetermines whether the specified object is equal to this instance.
public override bool Equals(object obj)
obj
objectReturns a hash code for this struct.
public override int GetHashCode()
Returns a 32-bit ARGB value that represents this HSL color.
public int ToArgb()
Returns a System.Drawing.Color that represents this HSL color.
public Color ToColor()
Returns a string representation of this HSL color.
public override string ToString()
Tests whether two specified HslColor structures are equivalent.
public static bool operator ==(HslColor left, HslColor right)
Tests whether two specified HslColor structures are different.
public static bool operator !=(HslColor left, HslColor right)