Skip to content

v3:Migration from v1

fujaru edited this page Feb 6, 2017 · 8 revisions

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.

Changed Options

validate

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

Obsolete Options

color

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:

  1. Use $(input).wheelColorPicker('setRgb', r, g, b) to set color using RGB colors.
  2. Use $(input).wheelColorPicker('setRgba', r, g, b, a) to set color using RGB colors with alpha value.colors.
  3. Use $(input).wheelColorPicker('setHsv', h, s, v) to set color using HSV colors.
  4. Use $(input).wheelColorPicker('setHsva', h, s, v, a) to set color using HSV colors with alpha value.
  5. Use $(input).wheelColorPicker('setAlpha', a) to set only the alpha value.
  6. 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:

  1. Use `$(input).wheelColorPicker('getColor') to get all color components (RGBHSVA) in a JS object.

alpha

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.

Deprecated Options

preserveWheel

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.