Colorpicker

Colorpicker

Colorpicker widget class

Constructor

new Colorpicker(element, options)

Source:
Parameters:
Name Type Description
element Object | String
options Object
Fires:

Members

(static) Color :Color

Color class

Source:
Type:
  • Color

(static) Extension :Extension

Extension class

Source:
Type:

(static) extensions :Object

Colorpicker extension classes, indexed by extension name

Source:
Type:
  • Object

addonHandler :AddonHandler

Source:
Type:

color :Color|null

Internal color object

Source:
Type:
  • Color | null

colorHandler :ColorHandler

Source:
Type:

container :*|jQuery

The element where the

Source:
Type:
  • * | jQuery

element :*|jQuery

The element that the colorpicker is bound to

Source:
Type:
  • * | jQuery

extensions :Array.<Extension>

Extensions added to this instance

Source:
Type:

format :String|null

Internal color format

Source:
Type:
  • String | null

id :number

The colorpicker instance number

Source:
Type:
  • number

inputHandler :InputHandler

Source:
Type:

lastEvent :Object

Latest colorpicker event

Source:
Type:
  • Object

options :defaults

Source:
Type:

picker

Getter of the picker element

Source:

pickerHandler :PickerHandler

Source:
Type:

popupHandler :PopupHandler

Source:
Type:

sliderHandler :SliderHandler

Source:
Type:

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: