Class: wpColorPicker

wpColorPicker


new wpColorPicker()

Creates a jQuery UI color picker that is used in the theme customizer.
Since:
  • 3.5.0
Source:

Methods


<private> _addListeners()

Binds event listeners to the color picker.
Since:
  • 3.5.0
Source:
Returns:
Type
void

<private> _create()

Creates the color picker, sets default values, css classes and wraps it all in HTML.
Since:
  • 3.5.0
Source:
Returns:
Type
void

<private> _createHueOnly()

Creates a color picker that only allows you to adjust the hue.
Since:
  • 3.5.0
Source:
Returns:
Type
void

close()

Closes the color picker dialog.
Since:
  • 3.5.0
Source:
Returns:
Type
void

color(newColor)

Returns the iris object if no new color is provided. If a new color is provided, it sets the new color.
Parameters:
Name Type Description
newColor string | * The new color to use. Can be undefined.
Since:
  • 3.5.0
Source:
Returns:
The element's color.
Type
string

defaultColor(newDefaultColor)

Returns the iris object if no new default color is provided. If a new default color is provided, it sets the new default color.
Parameters:
Name Type Description
newDefaultColor string | * The new default color to use. Can be undefined.
Since:
  • 3.5.0
Source:
Returns:
The element's color.
Type
boolean | string

open()

Opens the color picker dialog.
Since:
  • 3.5.0
Source:
Returns:
Type
void