How do you calculate the div bg color from blue to lightblue to gray based on a percentage value? ex. if the value equals 100%, the div's bg color is #0000FF
; if the value equals 50%, it's light blue; if the value equals 0, the bg color is gray.
Does there have a algorithm work on this?
Thanks for any help.