Color Picker - Raphaël - 0 views
-
yc c on 04 Mar 10No images. No libraries*. Works even in IE6. // Color Picker by Raphaël - raphaeljs.com var icon = Raphael("picker", 23, 23).colorPickerIcon(11, 11, 10); icon.attr({cursor: "pointer"}).node.onclick = function () { document.getElementById("benefits").style.visibility = "visible"; var out = document.getElementById("output"); out.style.visibility = "visible"; // this is where colorpicker created var cp = Raphael.colorpicker(document.body.offsetWidth / 2 - 150, 250, 300, "#eee", document.getElementById("picker2")); out.onkeyup = function () { cp.color(this.value); }; // assigning onchange event handler cp.onchange = function (clr) { out.value = clr; document.body.style.background = clr; document.body.style.color = Raphael.rgb2hsb(clr).b s it. Too easy icon.node.onclick = null;};