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
Changing from red to green color using HLS. The value should be from 0 to 100, in this case simulating percentage (%).
red
green
function getColorFromRedToGreenByPercentage(value) { const hue = Math.round(value); return ["hsl(", hue, ", 50%, 50%)"].join(""); }