I am setting the colour value based on range from 0 to 100 (red to green)
As of now, a simple snippet
value = 5
colour = ""
if value <= 25:
colour = "#FF0000" # red
elif value > 25 and value <= 50:
colour = "FF8000" # orange
elif value > 50 and value <=75:
colour = "#FFFF00" # yellow
elif value > 75 and value < 100:
colour = "#53d926" # light green
Is it possible to set colour automatically (gradient pattern, from red > orange > yellow > not complete green)?
as 100 indicates complete success (green).
Right now, only four colours. But based on varying percentage, it should set the colour accordingly for any value (combination of colours from red > orange > yellow > not complete green, with respective to values)
Any smart way to handle this ?