| Package | ardisia.utils |
| Class | public final class HSLColor |
| Inheritance | HSLColor Object |
See http://en.wikipedia.org/wiki/HSL_color_space for a general explanation of the HSL color space and see http://www.niwa.nu/2013/05/math-behind-colorspace-conversions-rgb-hsl/ for a great explanation of the Math behind the code below in plain English.
| Property | Defined By | ||
|---|---|---|---|
| hue : Number
Hue. | HSLColor | ||
| luminosity : Number
Luminosity. | HSLColor | ||
| saturation : Number
Saturation. | HSLColor | ||
| Method | Defined By | ||
|---|---|---|---|
HSLColor(hue:Number = 1, saturation:Number = 1, luminosity:Number = 1) | HSLColor | ||
convertHSLtoRGB(h:Number, s:Number, l:Number):uint [static]
Convert HSL color to RGB. | HSLColor | ||
convertRGBtoHSL(rgb:uint):HSLColor [static]
Convert RGB color to HSL. | HSLColor | ||
| hue | property |
public var hue:NumberHue. Varies from 0 to 360.
The default value is null.
| luminosity | property |
public var luminosity:NumberLuminosity. Varies from 0 to 1.
The default value is null.
| saturation | property |
public var saturation:NumberSaturation. Varies from 0 to 1.
The default value is null.
| HSLColor | () | Constructor |
public function HSLColor(hue:Number = 1, saturation:Number = 1, luminosity:Number = 1)hue:Number (default = 1) | |
saturation:Number (default = 1) | |
luminosity:Number (default = 1) |
| convertHSLtoRGB | () | method |
public static function convertHSLtoRGB(h:Number, s:Number, l:Number):uintConvert HSL color to RGB. See http://en.wikipedia.org/wiki/HSL_color_space.
Hue set is [0, 360]; Saturation and Luminosity sets are [0, 1].
Good English language explanation for the Math behind this code can be found at http://colorgrader.net/index.php/dictionary-a-tutorials/color-theory/93-math-behind-colorspace-conversions-rgb-hsl.html
Parameters
h:Number — hue value
| |
s:Number — saturation value
| |
l:Number — lightness value
|
uint — the uint RGB color
|
| convertRGBtoHSL | () | method |
public static function convertRGBtoHSL(rgb:uint):HSLColorConvert RGB color to HSL.
Hue set is [0 - 360]; Saturation and Luminosity sets are [0, 1].
Good English language explanation for the Math behind this code can be found at http://www.niwa.nu/2013/05/math-behind-colorspace-conversions-rgb-hsl/
Parameters
rgb:uint — a RGB color value
|
HSLColor — An HSLColor object
|