HslColor Class

Version 1.0.2
.NET Framework 4.7
Namespace Skybrud.Colors
Assembly Skybrud.Colors.dll
Visibility Public
Interfaces IColor
Inheritance Object

Class representing a color in the HSL color model. HSL stands for hue, saturation, and lightness.

public class HslColor : IColor { }

Properties

Type Name Summary
Double Hue

Gets the hue as a number between 0 and 1. For the hue as the degrees of a circle, simply multiply by 360.

Double Saturation

Gets the saturation as a number between 0 and 1. For the hue as percent, simply multiply by 100.

Double Lightness

Gets the lightness as a number between 0 and 1. For the hue as percent, simply multiply by 100.

Double H

Alias of HslColor.Hue.

Double S

Alias of HslColor.Saturation.

Double L

Alias of HslColor.Lightness.

Methods

Darken(float) (virtual)

Increases the darkness of the color based on the specified percent.

Lighten(float) (virtual)

Increases the lightness of the color based on the specified percent.

ToCmy() (virtual)

Converts the HSL color to a CMY color.

ToCmyk() (virtual)

Converts the HSL color to a CMYK color.

ToCss() (virtual)

Returns the CSS representation of the color. The color will be expressed as hsl(0, 0%, 0%).

ToHex() (virtual)

Returns the HEX representation of the color.

ToHsl() (virtual)

Returns a new HslColor with the same color as specified by the HslColor.Hue, HslColor.Saturation and HslColor.Lightness properties.

ToRgb() (virtual)

Converts the HSL color to a RGB color.

ToString() (virtual)

Returns a string representation of the HSL color.