Kelvin → RGB
Color temperature (Kelvin) to approximate sRGB.
Overview
The Kelvin → RGB tool converts a colour temperature in kelvin (typically 1000K to 12000K) into the approximate sRGB swatch a black-body radiator would emit at that temperature. Useful for previewing colour balance, lamp colour, and the warm-to-cool axis that camera and lighting tooling exposes as a single slider.
It is aimed at photographers cross-referencing white balance values, web designers picking accent colours that feel "warm" or "cool", and lighting designers visualising the colour of a lamp before specifying it. Game and 3D developers use it to set scene tint values consistent with real lighting.
How it works
The conversion uses the well-known Tanner Helland approximation, which is a piecewise polynomial fit to the Planckian locus chromaticity curve. Each kelvin value yields a red, green and blue channel via three temperature-dependent formulas, with separate branches above and below roughly 6600K.
The result is then clamped to the 0–255 range and re-encoded as sRGB hex. Because it is an approximation of black-body radiation, the output is not a perfect match for any specific real-world lamp — but it tracks the warm/cool perception well enough for design previews.
Examples
1900K → #ff8a18 (candlelight)
2700K → #ffb16e (warm tungsten)
4000K → #ffd0a4 (neutral)
5600K → #ffeede (daylight)
6500K → #ffffff (D65 reference white)
9000K → #c6ddff (cool overcast)
FAQ
Is D65 really 6500K?
D65 is defined at a correlated colour temperature of 6504K and is the white point used by sRGB, but the approximation models pure black-body radiation, so the rendered swatch at 6500K may be slightly cooler than a calibrated D65 monitor.
Why does my warm white lamp look pinker than the swatch?
Real lamps emit a mix of black-body and fluorescent spectra. The Planckian locus is a single curve; actual lamps fall off it on the green or magenta axis, which is why "Duv" is reported alongside CCT in professional lighting tools.
Can I use this for colour grading?
Yes, as a starting point. The hex value is a reasonable approximation of the colour cast a given temperature produces, but final grading is usually done with a 3D LUT for nuance.
What is the visible range?
Roughly 1000K (candle) to 10,000K (clear blue sky). Below 1000K the curve approaches deep red; above 25,000K it asymptotes to a blue-white that barely changes.