07/06/21 09:28:59
function pick(x, y) {
var t=Math.atan2(y-250,x-250), l=Math.sqrt((y-250)*(y-250)+(x-250)*(x-250));
l = (Math.max(Math.min(l, 250), 50) - 50) / 200; t = (t/(Math.PI*2)+1)%1;
var rgb = hsb2rgb(t, 1, l), elt = document.getElementById('h1');
elt.innerHTML = rgb; elt.style.backgroundColor = rgb;
}
</script>
</head><body onload="init()">
<h1 id="h1" style="position:absolute; top:520px">Color Picker</h1>
</body></html>