Construct a new color with r=0 g=0 b=0
.
Consider using the makeHex
, makeRGB
or makeHSL
functions.
Get the alpha channel (transparency) of this color.
A value between 0.0 and 1.0.
Get the blue component of this RGB(A) color. This method just returns the b
color attribute.
A value between 0.0 and 1.0.
Create a clone of this color (RGB).
A clone of this color (in RGB mode).
Get this color as a CSS-HEX string (non-alpha): #rrggbb
This color as a CSS-HEX string.
Get this color as a CSS hsl
string.
This color as a CSS hsl string.
Get this color as a CSS hsla
string.
This color as a CSS hsla string.
Get this color as a CSS rgb
string.
Consult this for details: https://developer.mozilla.org/en-US/docs/Web/CSS/color_value
This color as a CSS rgb string.
Get this color as a CSS rgba
string.
Consult this for details: https://developer.mozilla.org/en-US/docs/Web/CSS/color_value
This color as a CSS rgba string.
Get the green component of this RGB(A) color. This method just returns the g
color attribute.
A value between 0.0 and 1.0.
Get the hue component of this HSL(A) color. This method just returns the h
color attribute.
A value between 0.0 and 1.0.
Get the lightness component of this HSL(A) color. This method just returns the l
color attribute.
A value between 0.0 and 1.0.
Get the red component of this RGB(A)color. This method just returns the r
color attribute.
A value between 0.0 and 1.0.
Get the saturation component of this HSL(A) color. This method just returns the s
color attribute.
A value between 0.0 and 1.0.
Parse the given color string. Currently only these formate are recognized: hex, rgb, rgba.
The string representation to parse.
The color instance that's represented by the given string.
Calculates RGB color (nomalized). HSL must be normalized.
Calculates HSL Color. RGB must be normalized. http://mjijackson.com/2008/02/rgb-to-hsl-and-rgb-to-hsv-color-model-conversion-algorithms-in-javascript
Check a hexa color (without #)
Generated using TypeDoc
A color class, inspired by neolitec's Javascript class. Original found at https://gist.github.com/neolitec/1344610 Thanks to neolitec