/plugins/jquery.colorpicker.js

https://github.com/andradeandrey/raphael · JavaScript · 16 lines · 9 code · 0 blank · 7 comment · 1 complexity · 9ab29c70c5899eee7f3630e1828b84dd MD5 · raw file

  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);