Skip to content

Instantly share code, notes, and snippets.

@heedaelee
heedaelee / colorTempToRGB.js
Created January 19, 2020 09:20 — forked from paulkaplan/colorTempToRGB.js
Color Temperature to RGB
// From http://www.tannerhelland.com/4435/convert-temperature-rgb-algorithm-code/
// Start with a temperature, in Kelvin, somewhere between 1000 and 40000. (Other values may work,
// but I can't make any promises about the quality of the algorithm's estimates above 40000 K.)
function colorTemperatureToRGB(kelvin){
var temp = kelvin / 100;