To use jQuery Wheel Color Picker Plugin, first you must include jquery.js
(obviously),
jquery.wheelcolorpicker.js
, and wheelcolorpicker.css
.
There are two ways to initialize color picker. One is by adding
data-wheelcolorpicker
attribute to the input element. The other
way is by invoking $(element).wheelColorPicker()
jQuery function.
When simply initializing wheel color picker with default options, a color picker is displayed as a popup under the input element containing a color wheel, value slider, and a preview box. The value generated by the color picker is in hexadecimal RGB format. If you change the format to something with alpha, an alpha slider will be added in addition to the color wheel and value component slider.
Besides the default sliders, you may also display other color component sliders and rearrange their positions.
By default the color picker widget is automatically resizes to fit the sliders. However, you may also set a custom size to it by specifying width and height via CSS. This feature only applies to desktop website. For mobile browser, color picker will automatically adjusted to fit browser screen.
Color picker can also be embedded inline.
Selected color:
By accessing color components in RGB or HSV, it is possible to manipulate colors with ease.
Various events occurring on the color picker are passed to the respective input element.
Project homepage
Project documentation
Source code repository at GitHub