Color Picker & Color Wheel
[raphael] / plugins / jquery.colorpicker.js
diff --git a/plugins/jquery.colorpicker.js b/plugins/jquery.colorpicker.js
new file mode 100644 (file)
index 0000000..9c3f7f2
--- /dev/null
@@ -0,0 +1,16 @@
+/*!
+ * Color Picker 0.1.0 - Raphael plugin
+ *
+ * Copyright (c) 2010 Dmitry Baranovskiy (http://raphaeljs.com)
+ * Based on Color Wheel (http://jweir.github.com/colorwheel) by John Weir (http://famedriver.com)
+ * Licensed under the MIT (http://www.opensource.org/licenses/mit-license.php) license.
+ */
+(function ($, R) {
+    $.fn.colorpicker = function (size, initcolor) {
+        if (R) {
+            var offset = this.offset();
+            return R.colorpicker(offset.left, offset.top, size, initcolor, this[0]);
+        }
+        return null;
+    };
+})(window.jQuery, window.Raphael);
\ No newline at end of file