Namespace kh.color
Defined in: kh-color.js.
Constructor Attributes | Constructor Name and Description |
---|---|
Method Attributes | Method Name and Description |
---|---|
<static> |
kh.color.cssToRGB(aStr)
Returns a instance of RGB object, from a string parameter.
|
<static> |
kh.color.forceIntRange(i, min, max)
|
Method Detail
<static>
{RGB}
kh.color.cssToRGB(aStr)
Returns a instance of RGB object, from a string parameter.
Recognized strings: * 6 digits hexadecimal, begining with a sharp (#) or not (ex: #ffffff, ffffff) * 3 digits hexadecimal, begining with a sharp (#) or not (ex: #fff, fff) * rgb notation with integer (ex: rgb(0, 100, 255)) * rgb notation with percentage (ex: rgb(0%, 50%, 100%)) * hsv notation (ex: hsv(200, 50, 50)) * hsl notation (ex: hsl(200, 50, 50) or hsl(200, 50%, 50%)) * HTML 4 names * CSS 3 names. Optional, you just need to link to the file 'kh-csscolors.js' in your document.If no conversion can be done, a default RGB is returned (rgb(0,0,0) = black)
TODO: defined in CSS 3 :hsl(n,n,n)hsla(n,n,n,n) rgba(n, n, n, n)named svg colors ?
- Parameters:
- {String} aStr
- Returns:
- {RGB} object
<static>
{Integer}
kh.color.forceIntRange(i, min, max)
- Parameters:
- {Integer} i
- {Integer} min
- {Integer} max
- Returns:
- {Integer}