Someone knows an algorithm that gets temperatue in Kelvin/Celsius and returns RGB?
Like in thermal cameras.
I found some links :
http://www.brucelind
Color temperature is based on the actual color of light emitted from something (theoretically, an "ideal black body") that emits light based solely on its temperature.
Some examples of this kind of light source: if you have an electric stove element that is glowing red, it might be around 1000K. A regular incandescent bulb filament is around 2700K, and the sun is roughly 5700K. All three are fair approximations of a "black body"; they emit a particular spectrum of light based on their actual temperature.
Many artificial light sources are not actually the "temperature" of the light they emit (and their spectra are generally not black-body spectra, either...). Instead, their "temperature" rating is the temperature a theoretical black body would have to be in order to emit light of that color. There are also colors that cannot be generated by a black body: light which is greenish or purplish compared to a more "natural"-looking black body illumination.
As mentioned in one of the comments, the kind of thermal camera displays you are probably thinking about are all false-color. In a false-color display, the colors are chosen for convenience only: so, for a thermal camera they might choose a "hot"-looking red for warm, and "cold"-looking blue for cold. But, they could just as easily choose a range from black to white, or fuschia to green.
Because false-color displays are arbitrary, you really need to check the color key to a particular image or system if you want to estimate the temperature (scientific images should generally have some kind of color key for this purpose). If you have no color key, and no documentation on how the image was generated, you are out of luck.