Constructor
new Colorpicker(element, options)
- Source:
Parameters:
Name | Type | Description |
---|---|---|
element |
Object
|
String
|
|
options |
Object
|
Fires:
Members
(static) extensions :Object
Colorpicker extension classes, indexed by extension name
- Source:
Type:
-
Object
element :*|jQuery
The element that the colorpicker is bound to
- Source:
Type:
-
*
|jQuery
Methods
destroy()
Destroys the current instance
- Source:
Fires:
disable() → {boolean}
Disables the widget and the input if any
- Source:
Fires:
Returns:
- Type:
-
boolean
enable() → {boolean}
Enables the widget and the input if any
- Source:
Fires:
Returns:
- Type:
-
boolean
getValue(defaultValueopt) → {String|*}
Returns the current color value as string
- Source:
Parameters:
Name | Type | Attributes | Default | Description |
---|---|---|---|---|
defaultValue |
String
|
*
|
<optional> |
null |
Returns:
- Type:
-
String
|*
hide(eopt)
Hides the colorpicker widget.
- Source:
Parameters:
Name | Type | Attributes | Description |
---|---|---|---|
e |
Event
|
<optional> |
Fires:
isDisabled() → {boolean}
Returns true if this instance is disabled
- Source:
Returns:
- Type:
-
boolean
isEnabled() → {boolean}
Returns true if this instance is enabled
- Source:
Returns:
- Type:
-
boolean
registerExtension(ExtensionClass, configopt) → {Extension}
Creates and registers the given extension
- Source:
Parameters:
Name | Type | Attributes | Description |
---|---|---|---|
ExtensionClass |
Extension
|
The extension class to instantiate |
|
config |
Object
|
<optional> |
Extension configuration |
Returns:
- Type:
-
Extension
setValue(val)
Sets the color manually
- Source:
Parameters:
Name | Type | Description |
---|---|---|
val |
String
|
Color
|
Fires:
show(eopt)
Shows the colorpicker widget if hidden. If the colorpicker is disabled this call will be ignored.
- Source:
Parameters:
Name | Type | Attributes | Description |
---|---|---|---|
e |
Event
|
<optional> |
Fires:
toggle(eopt)
Toggles the colorpicker between visible and hidden.
- Source:
Parameters:
Name | Type | Attributes | Description |
---|---|---|---|
e |
Event
|
<optional> |
Fires:
trigger(eventName, color, value)
Triggers a Colorpicker event.
- Source:
Parameters:
Name | Type | Default | Description |
---|---|---|---|
eventName |
|||
color |
null | ||
value |
null |
update()
Updates the UI and the input color according to the internal color.
- Source:
Fires:
Events
change
(Input) Triggered on the input element when a new color is selected.
- Source:
Listeners of This Event:
colorpickerChange
(Colorpicker) When the color is set programmatically with setValue().
- Source:
Listeners of This Event:
colorpickerCreate
(Colorpicker) When the Colorpicker instance has been created and the DOM is ready.
- Source:
Listeners of This Event:
colorpickerDestroy
(Colorpicker) When the instance is destroyed with all events unbound.
- Source:
Listeners of This Event:
colorpickerDisable
(Colorpicker) When the widget has been disabled.
- Source:
Listeners of This Event:
colorpickerEnable
(Colorpicker) When the widget has been enabled.
- Source:
Listeners of This Event:
colorpickerHide
(Colorpicker) When hide() is called and the widget can be hidden.
- Source:
Listeners of This Event:
colorpickerInvalid
(Colorpicker) Fired when the color is invalid and the fallback color is going to be used.
- Source:
Listeners of This Event:
colorpickerShow
(Colorpicker) When show() is called and the widget can be shown.
- Source:
Listeners of This Event:
colorpickerUpdate
(Colorpicker) Fired when the widget is updated.
- Source:
Listeners of This Event:
mousemove
(window.document) Triggered on mousedown for the document object, so the color adjustment guide is moved to the clicked position.
- Source: