Partilhar via


HslColor Class

Definition

HueSatLumColor represents colors by their Hue-Saturation-Luminosity value rather than the traditional RGB value. This class provides conversion methods to go back and forth between the HSL and RGB color spaces.

public ref class HslColor
[System.ComponentModel.TypeConverter(typeof(Microsoft.VisualStudio.Modeling.Diagrams.HslColorConverter))]
[System.Serializable]
public class HslColor
[<System.ComponentModel.TypeConverter(typeof(Microsoft.VisualStudio.Modeling.Diagrams.HslColorConverter))>]
[<System.Serializable>]
type HslColor = class
Public Class HslColor
Inheritance
HslColor
Attributes

Constructors

HslColor()

Default constructor creates an empty instance of the class.

HslColor(Int32, Int32, Int32)

Creates instance of the class with the specified hue, saturation, and luminosity.

Properties

Black

Pre-defined color.

Hue

Gets or sets the Hue property.

Luminosity

Gets or sets the Luminosity property.

Saturation

Gets or sets the Saturation property.

White

Pre-defined color.

Methods

FromRgbColor(Color)

Converts an RGB color representation to an HSL color representation. The algorithm implemented is from the following KnowledgeBase article: http://support.microsoft.com/default.aspx?scid=kb%3ben-us%3b29240, and from "Computer Graphics: Principles and Practices" by Foley, vanDam, et.al., pp. 592-596.

ToRgbColor()

Converts an HSL color representation to an RGB color representation. The algorithm implemented is from the following KnowledgeBase article: https://support.microsoft.com/default.aspx?scid=kb%3ben-us%3b29240, and from "Computer Graphics: Principles and Practices" by Foley, vanDam, et.al., pp. 592-596.

Applies to