-
Notifications
You must be signed in to change notification settings - Fork 31
v3:Migration from v1
Some options and methods which are marked as deprecated in v2 are now obsolete.
Due to major change in HTML structure, CSS adjustments made in v1 is not compatible with v3.
Previously, validate
options is set to automatically format the input value. The option is now split into two options: validate
and autoFormat
.
When validate
in v1 is set to true
, set the following options in v3:
validate: true,
autoFormat: true
When validate
in v1 is set to false
, set the following options in v3:
validate: false,
autoFormat: false
Individual color channel values are now consistently stored as an object. By implementing this way we now have several alternatives to retrieve and set color values:
Set color value
To set the color, Use $(input).wheelColorPicker('setValue', value)
instead.
Alternatives:
- Use
$(input).wheelColorPicker('setRgb', r, g, b)
to set color using RGB colors. - Use
$(input).wheelColorPicker('setRgba', r, g, b, a)
to set color using RGB colors with alpha value.colors. - Use
$(input).wheelColorPicker('setHsv', h, s, v)
to set color using HSV colors. - Use
$(input).wheelColorPicker('setHsva', h, s, v, a)
to set color using HSV colors with alpha value. - Use
$(input).wheelColorPicker('setAlpha', a)
to set only the alpha value. - Use
$(input).wheelColorPicker('setColor', object)
to set color using either RGB(A) or HSV(A) as an object.
Get color value
To retrieve color, use $(input).wheelColorPicker('getValue', format)
instead.
Alternatives:
- Use `$(input).wheelColorPicker('getColor') to get all color components (RGBHSVA) in a JS object.
The new plugin now has 7 sliders which can be displayed/hidden individually. The alpha slider is one of them, which can be set using sliders
option.
For example, to have the color wheel, value, and alpha slider, use $(input).wheelColorPicker('sliders', 'wva');
More information about the sliders
option can be viewed here.
The option has been renamed to live
. Please note that the value is inversed.
When preserveWheel
in v1 is set to true
, set live
to false
.
When preserveWheel
in v1 is set to false
, set live
to true
.