Color Picker & Color Wheel
[raphael] / plugins / jquery.colorpicker.js
1 /*!
2  * Color Picker 0.1.0 - Raphael plugin
3  *
4  * Copyright (c) 2010 Dmitry Baranovskiy (http://raphaeljs.com)
5  * Based on Color Wheel (http://jweir.github.com/colorwheel) by John Weir (http://famedriver.com)
6  * Licensed under the MIT (http://www.opensource.org/licenses/mit-license.php) license.
7  */
8 (function ($, R) {
9     $.fn.colorpicker = function (size, initcolor) {
10         if (R) {
11             var offset = this.offset();
12             return R.colorpicker(offset.left, offset.top, size, initcolor, this[0]);
13         }
14         return null;
15     };
16 })(window.jQuery, window.Raphael);