I have a poll system and I want answers for this poll to be colored. For example: If it\'s 10% it would be red, if 40% it would be yellow and if 80% it would be green, so I
HSL will work in IE8 using jquery-ui-1.10.4.
I modified jongo45's answer to accept lightness in the function.
function getColor(value, lightness) { //value from 0 to 1 var hue = ((value) * 120).toString(10); return ["hsl(", hue, ",100%,", lightness, "%)"].join(""); }