photonui.ColorPicker Class
A Color Picker.
wEvents:
- value-changed:
- description: the selected color changed.
- callback: function (widget, color)
value-changed-final: - description: called when the value is no more modified after continuous changes - callback: function (widget, color)
Constructor
photonui.ColorPicker
(
-
params
Parameters:
-
params
ObjectAn object that can contain any property of the widget (optional).
Item Index
Methods
- __onContextMenu
- __onDragEnd
- __onDraggingCircle
- __onDraggingSquare
- __onDragStart
- __onLocaleChanged
- __onMouseDown
- __onMouseMove
- __onMouseUp
- __onValueChanged
- _bindEvent
- _buildHtml
- _callCallbacks
- _pointerAngle
- _pointerOnCircle
- _pointerOnSquare
- _registerWEvents
- _unbindEvent
- _updateCanvas
- _updateH
- _updateProperties deprecated
- _updateSB
- _updateSBmask
- _visibilityChanged
- addClass
- destroy
- hide
- registerCallback
- removeCallback
- removeClass
- show
- unparent
Methods
__onContextMenu
(
private
-
event
Called when the context menu should be displayed.
Parameters:
-
event
Object
__onDraggingCircle
(
private
-
manager
-
mstate
Parameters:
-
manager
photonui.MouseManager -
mstate
Object
__onDraggingSquare
(
private
-
manager
-
mstate
Parameters:
-
manager
photonui.MouseManager -
mstate
Object
__onLocaleChanged
()
private
Called when the locale is changed.
__onValueChanged
()
private
_bindEvent
(
private
-
id
-
element
-
evName
-
callback
-
[options]
Javascript event binding (for internal use).
Parameters:
_buildHtml
()
private
Build the widget HTML.
_callCallbacks
(
private
-
wEvent
-
params
Call all callbacks for the given wEvent.
NOTE: the first argument passed to the callback is the current widget.
NOTEĀ²: if the thisArg of the callback is null, this will be binded to the current widget.
_pointerAngle
(
Number
private
-
mstate
the angle of the pointer with the horizontal line that pass by the center of the hue circle.
Parameters:
-
mstate
Object
Returns:
Number:
the angle in degree.
_pointerOnCircle
(
Boolean
private
-
mstate
Is the pointer on the hue circle?
Parameters:
-
mstate
Object
Returns:
_pointerOnSquare
(
Boolean
private
-
mstate
Is the pointer on the SB Square?
Parameters:
-
mstate
Object
Returns:
_updateCanvas
()
private
Update the canvas
_updateH
()
private
Update hue circle
_updateProperties
(
deprecated
private
-
properties
Force the update of the given properties.
This method is deprecated.
One should use '@photonui-update' abitbol's annotation on concerned properties.
Parameters:
-
properties
ArrayThe properties to update.
_updateSB
()
private
Update saturation/brightness square
_updateSBmask
()
private
Update saturation/brightness square mask
_visibilityChanged
(
private
-
visibility
Called when the visibility changes.
Parameters:
-
visibility
BooleanCurrent visibility state (otptional, defaut=this.visible)
addClass
(
-
className
Add a class to the outer HTML element of the widget.
Parameters:
-
className
StringThe class to add.
destroy
()
Destroy the widget.
hide
()
Hide the widget (equivalent to widget.visible = false).
registerCallback
(
-
id
-
wEvent
-
callback
-
thisArg
Register a callback for any PhotonUI/Widget event (called wEvent).
Callback signature:
function (Object(Base/Widget) [, arg1 [, arg2 [, ...]]])
removeClass
(
-
className
Remove a class from the outer HTML element of the widget.
Parameters:
-
className
StringThe class to remove.
show
()
Display the widget (equivalent to widget.visible = true).
unparent
()
Detache the widget from its parent.