Temperature into a color

There is an example at https://discourse.nodered.org/t/warp-speed-indicator-changing-background-colour-according-to-payload-value-css-only/57256 showing one way to change the background of a dashboard template according to the input payload.

It's not very straightforward, surely it could be done more easily!