Dela via


HslColor Class

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.

Inheritance Hierarchy

System.Object
  Microsoft.VisualStudio.Modeling.Diagrams.HslColor

Namespace:  Microsoft.VisualStudio.Modeling.Diagrams
Assembly:  Microsoft.VisualStudio.Modeling.Sdk.12.0 (in Microsoft.VisualStudio.Modeling.Sdk.12.0.dll)

Syntax

'Declaration
<SerializableAttribute> _
<TypeConverterAttribute(GetType(HslColorConverter))> _
Public Class HslColor
[SerializableAttribute]
[TypeConverterAttribute(typeof(HslColorConverter))]
public class HslColor
[SerializableAttribute]
[TypeConverterAttribute(typeof(HslColorConverter))]
public ref class HslColor
[<SerializableAttribute>]
[<TypeConverterAttribute(typeof(HslColorConverter))>]
type HslColor =  class end
public class HslColor

The HslColor type exposes the following members.

Constructors

  Name Description
Public method HslColor() Default constructor creates an empty instance of the class.
Public method HslColor(Int32, Int32, Int32) Creates instance of the class with the specified hue, saturation, and luminosity.

Top

Properties

  Name Description
Public propertyStatic member Black Pre-defined color.
Public property Hue Gets or sets the Hue property.
Public property Luminosity Gets or sets the Luminosity property.
Public property Saturation Gets or sets the Saturation property.
Public propertyStatic member White Pre-defined color.

Top

Methods

  Name Description
Public method Equals Determines whether the specified object is equal to the current object. (Inherited from Object.)
Protected method Finalize Allows an object to try to free resources and perform other cleanup operations before it is reclaimed by garbage collection. (Inherited from Object.)
Public methodStatic member FromRgbColor Converts an RGB color representation to an HSL color representation.
Public method GetHashCode Serves as the default hash function. (Inherited from Object.)
Public method GetType Gets the Type of the current instance. (Inherited from Object.)
Protected method MemberwiseClone Creates a shallow copy of the current Object. (Inherited from Object.)
Public method ToRgbColor Converts an HSL color representation to an RGB color representation.
Public method ToString Returns a string that represents the current object. (Inherited from Object.)

Top

Thread Safety

Any public static (Shared in Visual Basic) members of this type are thread safe. Any instance members are not guaranteed to be thread safe.

See Also

Reference

Microsoft.VisualStudio.Modeling.Diagrams Namespace