[]
        
(Showing Draft Content)

GrapeCity.Documents.Drawing.HslColor

Struct HslColor

Namespace
GrapeCity.Documents.Drawing
Assembly
GcDocs.Imaging.dll

Represents a color in HSL (hue, saturation, lightness) color model.

public struct HslColor : IEquatable<HslColor>
Implements
System.IEquatable<T><HslColor>
Inherited Members
object.Equals(object, object)
object.ReferenceEquals(object, object)
object.GetType()

Constructors

HslColor(Color)

Initializes a new instance of the HslColor struct from a System.Drawing.Color value.

public HslColor(Color color)

Parameters

color System.Drawing.Color

HslColor(int)

Initializes a new instance of the HslColor struct from a 32-bit ARGB value.

public HslColor(int argb)

Parameters

argb int

HslColor(float, float, float, float)

Initializes a new instance of the HslColor struct.

public HslColor(float hue, float saturation, float lightness, float opacity = 1)

Parameters

hue float

Hue value in the range [0, 360].

saturation float

Saturation value in the range [0, 1].

lightness float

Lightness value in the range [0, 1].

opacity float

Opacity value in the range [0, 1].

Properties

Hue

Gets or sets the hue value in the range [0, 360].

public float Hue { get; set; }

Property Value

float

Lightness

Gets or sets the lightness value in the range [0, 1].

public float Lightness { get; set; }

Property Value

float

Opacity

Gets or sets the opacity value in the range [0, 1].

public float Opacity { get; set; }

Property Value

float

Saturation

Gets or sets the saturation value in the range [0, 1].

public float Saturation { get; set; }

Property Value

float

Methods

Equals(HslColor)

Determines whether the specified HslColor is equal to this instance.

public bool Equals(HslColor other)

Parameters

other HslColor

Returns

bool

Equals(object)

Determines whether the specified object is equal to this instance.

public override bool Equals(object obj)

Parameters

obj object

Returns

bool

GetHashCode()

Returns a hash code for this struct.

public override int GetHashCode()

Returns

int

ToArgb()

Returns a 32-bit ARGB value that represents this HSL color.

public int ToArgb()

Returns

int

ToColor()

Returns a System.Drawing.Color that represents this HSL color.

public Color ToColor()

Returns

System.Drawing.Color

ToString()

Returns a string representation of this HSL color.

public override string ToString()

Returns

string

Operators

operator ==(HslColor, HslColor)

Tests whether two specified HslColor structures are equivalent.

public static bool operator ==(HslColor left, HslColor right)

Parameters

left HslColor
right HslColor

Returns

bool

operator !=(HslColor, HslColor)

Tests whether two specified HslColor structures are different.

public static bool operator !=(HslColor left, HslColor right)

Parameters

left HslColor
right HslColor

Returns

bool