Let sensor drive light color

is there a way how I can use the value of a sensor e.g., the temperature, to set the color or the brightness of lights … for example: the warmer it is the more red the light color becomes?