Colour thresholds based on query values

Is it possible to set the colour values based on a percentage of another query?

I have a repeated single stat panel showing the efficiency of a variable value. I would like to colour this either red or green based on proximity to its planned efficiency.