Heyoh SO,
I have a temperature widget to implement on a project I am working on. Nothing is specially difficult, I\'ve got a free API to retrieve the datas that I need e
Your colour range looks to be the same as a "hue-only" sweep in "HSL colour space" from 270º (violetish) at -30ºC down to 30º (orange) at +30ºC
var hue = 30 + 240 * (30 - t) / 60;
If t is out of range, either clamp it before calling the above expression, or clamp h to the desired hue range afterwards.
On supported browsers you can use an hsl(h, s, l) colour string, or use commonly available "HSL to RGB" functions to convert the HSL colour into RGB.
See http://jsfiddle.net/V5HyL/