function HSVtoRGB(h,s,v,opacity){ // inputs h=hue=0-360, s=saturation=0-1, v=value=0-1 // algorithm from Wikipedia on HSV conversion var toHex=function(decimalValue,places){ if(places == undefined || isNaN(places)) places = 2; var hex = new Array("0","1","2","3","4","5","6","7","8","9","A","B","C","D","E","F"); var next = 0; var hexidecimal = ""; decimalValue=Math.floor(decimalValue); while(decimalValue > 0){ next = decimalValue % 16; decimalValue = Math.floor((decimalValue - next)/16); hexidecimal = hex[next] + hexidecimal; } while (hexidecimal.length