Change Widget color depending on the data of the sensor

I am using Openhab 3 and i have 2 sensors (dht22 and capacitive moisture sensor) and i want to change the color of the widgets that i have in the panel presenting the sensors data
I wold like to change from green to red if hits a certain value.
Can somoene help me? thank you

I use this code to change the color depending on it’s state…

color: '=(items.YourItme.state === "OFF") ? "green" : "red"'

Maybe this is what you are looking for?

But where do you put that code and is that code to change the color of this?
Sem título