class
SAPO.Component.ColorWheel
Version:
0.1
Since:
Defined in
Component/ColorWheel/0.1/lib.js
September 2011
Constructor Summary
ColorWheel
(Object
o)
Function Summary
returns a CSS color in the form hsl(h, s%, l%)
gets the component's color in hexadecimal format
returns a CSS color in the form rgb(r, g, b) or rgba(r, g, b, a) if opacity !== 1
Number
getOpacity()
returns the opacity parameter of the color (only set explicitly (via setOpacity) or by reading an RGBA color)
setOpacity
(Number
v)
set the opacity component of the color
Constructor Details
constructor ColorWheel
ColorWheel(Object
o)
Parameters:
o
-
[ String cssURI ]
URI to the CSS for the component. -
[ String|DOMElement container ]
where to place the component. default is document.body -
[ Number quadSide ]
inner rect side length in pixels. default is 160. -
[ Number arcLength ]
outer arc length in pixels. default is 30. -
[ Boolean exposeOpacity ]
if trueish, a vertical slider appear next to the color wheel so one can change the opacity value for the color
Function Details
function getColor
String
getColor()
returns a CSS color of the kind parsed earlier on with setColor
function getColorHSL
String
getColorHSL()
returns a CSS color in the form hsl(h, s%, l%)
function getColorHex
String
getColorHex()
gets the component's color in hexadecimal format
function getColorRGB
String
getColorRGB()
returns a CSS color in the form rgb(r, g, b) or rgba(r, g, b, a) if opacity !== 1
function getOpacity
Number
getOpacity()
returns the opacity parameter of the color (only set explicitly (via setOpacity) or by reading an RGBA color)
function setColor
setColor(String
v)
sets a color from a CSS color
Parameters:
v
CSS color function setOpacity
setOpacity(Number
v)
set the opacity component of the color
Parameters:
v
opacity value, between 0 and 1 (enforced)