Humidity led

i want to have a indicate the humidity with the help of an rgb led.

how do i configure this without making a mess ?
i currently had an automation for each 5% to show another color.
but this gives me a huge list in the automation configuration that i want to avoid
what i now have configured without getting to in detail:
50% or below humidity is led off
51% is blue
65% orange
80% or above red

this is handy especially in the bathroom when you now can see how humid it is without getting to your phone.

Should be able to do with a series of if statements:
set rgb = 0 # ie off
if humidity > 51 set b=255 # blue
if humidity > 65 set b=0, g=170, r=255 # orange
if humidity > 80 set g=0 # red