-
Notifications
You must be signed in to change notification settings - Fork 31
Plugin:Methods
Methods can be called by first selecting jQuery objects. The syntax is:
$(elm).wheelColorPicker('methodName', arg1, arg2, ...)
Setters/getters since 3.0
Since version 3.0, setter and getters (methods prefixed with "set" or "get") can be treated as options.
// Two ways to call setValue
$(elm).wheelColorPicker('setValue', '#ff0088');
$(elm).wheelColorPicker('value', '#ff0088');
// Two ways to call getValue
$(elm).wheelColorPicker('getValue');
$(elm).wheelColorPicker('value');
since 2.0
deprecated by 2.0
obsolete by 3.0
$(elm).wheelColorPicker('alpha' [, number value])
This function is made to maintain compatibility with deprecated alpha option.
since 1.x
deprecated by 2.0
obsolete by 3.0
$(elm).wheelColorPicker('color' [, string value])
Get/set color. This function is deprecated. To get color, use getValue()
and to set color, use setValue()
instead of this function.
Note: Since version 3.0, invoking the above code as getter will return color object instead of string.
since 1.x
$(elm).wheelColorPicker('destroy')
Destroy the color picker and return an element to its normal state.
since 2.0
object $(elm).wheelColorPicker('getColor')
Return color components as an object. The object consists of:
{
r: red,
g: green,
b: blue,
h: hue,
s: saturation,
v: value,
a: alpha
}
since 1.x
string $(elm).wheelColorPicker('getValue' [, string format])
Return the color value as string in specified format. If format is not provided, it will use the format specified in format
option. See colorToStr() for more information regarding available formats.
since 1.x
$(elm).wheelColorPicker('hide', event e)
Hide the color picker dialog. This function is only applicable to popup mode color picker layout.
since 1.x
$(elm).wheelColorPicker('init')
Initialize wheel color picker. There's no need to explicitly call init function as this function is automatically called during first time $(elm).wheelColorPicker([options])
is executed.
since 3.0
$(elm).wheelColorPicker( 'redrawSliders' [, boolean force] )
since 2.0
deprecated by 3.0
$(elm).wheelColorPicker( 'redrawSliders' [, string sliders [, boolean force]] )
since 3.0
$(elm).wheelColorPicker( 'refreshWidget' )
since 2.0
$(elm).wheelColorPicker( 'setAlpha', number value, boolean updateInput = true )
Set alpha value.
since 2.0
$(elm).wheelColorPicker( 'setColor', object color )
Set color by specifying component values. Supported color object values are set of RGB(A), HSV(A), or A only.
// Sets RGB(A)
{ r: 1, g: 0.5, b: 0.5 }
// Sets HSV(A)
{ h: 0.25, s: 1, v: 0.5 }
// Change alpha only to existing color
{ a: 0.8 }
since 2.0
$(elm).wheelColorPicker( 'setHsv', number h, number s, number v, boolean updateInput = true )
Set color using HSV combination. Each HSV component is a number between 0 to 1.
since 2.0
$(elm).wheelColorPicker( 'setHsva', number h, number s, number v, number a, boolean updateInput = true )
Set color using HSVA combination. Each HSVA component is a number between 0 to 1.
since 3.0
$(elm).wheelColorPicker( 'setOptions', object options )
Set multiple options to the color picker. if htmlOptions is set to true, options set via HTML attributes are also reloaded. If both HTML attributes and arguments exist, options set via options argument gets priority.
since 2.0
$(elm).wheelColorPicker( 'setRgb', number r, number g, number b, boolean updateInput = true] )
Set color using RGB combination. Each RGB component is a number between 0 to 1.
since 2.0
$(elm).wheelColorPicker( 'setRgba', number r, number g, number b, number a, boolean updateInput = true] )
Set color using RGBA combination. Each RGBA component is a number between 0 to 1.
since 1.x
$(elm).wheelColorPicker('setValue', string value, boolean updateInput = true] )
Set color value by providing string. Various formats are accepted. See strToColor() for available formats.
since 1.x
$(elm).wheelColorPicker('show')
Show the color picker dialog. This function is only applicable to popup mode color picker layout.
since 2.0
obsolete by 3.0
void $(elm).wheelColorPicker('staticInit')
Initialization for all color pickers. This function is called automatically during initialization of any first color picker. No need to call this function explicitly.
On version 3.0, this function is moved to $.fn.wheelColorPicker.ColorPicker.init()
since 3.0
$(elm).wheelColorPicker( 'updateInput' )
Update input value and background color (if preview
is on).
since 1.x
deprecated by 2.0
$(elm).wheelColorPicker('updateSelection')
Update color dialog selection to match current selectedColor value. This function is deprecated since it can be replaced by executing the following lines:
$(elm).wheelColorPicker('redrawSliders');
$(elm).wheelColorPicker('updateSliders');
since 2.0
$(elm).wheelColorPicker('updateSliders')
Update sliders cursor to match selected color.