Convert color temperature to RGB
Color temperature describes the hue of a light source on a warm-to-cool scale measured in Kelvin. This converter turns any blackbody temperature from 1000K to 40000K into an approximate sRGB and hex color, with a live swatch so you can preview the shift from orange candlelight through neutral daylight to deep blue sky. It is handy for lighting UIs, white-balance previews, and shader constants.
How it works
The tool implements Tanner Helland’s piecewise approximation of the Planckian locus. The Kelvin value is divided by 100, then each channel is computed from logarithmic and power curves fitted to measured blackbody data. Below about 6600K the red channel is pinned at 255 and blue is computed from a log curve; above it red falls off as a power curve while blue saturates. Every channel is finally clamped to the 0–255 range. The result is the color the light source appears, not the color of an object lit by it.
Common reference temperatures and their RGB
The presets in the tool cover the most useful benchmarks, but it helps to understand why these temperatures matter:
| Source | Temperature | Character |
|---|---|---|
| Candlelight | ~1800K | Deep amber-orange |
| Incandescent bulb | ~2700K | Warm orange-white |
| Warm white LED | ~3000K | Soft white |
| Neutral white | ~4000K | Clean white |
| D50 (print reference) | 5000K | Slightly warm white |
| D65 (sRGB white point) | 6500K | Near-neutral white |
| Overcast sky | ~7000K | Cool blue-white |
| Clear blue sky | ~10000K+ | Distinctly blue |
The D65 reference at 6500K is the white point sRGB monitors are calibrated to, which is why it converts to an almost perfectly equal RGB value.
Worked example
For a 2700K incandescent bulb the conversion yields roughly rgb(255, 169, 87) — orange-tinted and clearly warm. At 6500K (D65 daylight) you get approximately rgb(255, 249, 253), which is near-white with just a trace of blue. At 10000K the blue channel dominates visibly: roughly rgb(202, 218, 255).
Where to use this in practice
UI and game lighting: when you are building a day-night cycle or an indoor scene, the Kelvin temperature of each light source maps directly to the tint you add to that light’s color. Converting at 2700K gives you the exact RGB to apply to a lamp emitter.
White balance overlays: photographers and video editors who build custom LUTs or correction filters can use this to find the raw RGB of a white card under a given light source, which anchors their neutral point.
Shader constants: in GLSL or HLSL you sometimes need a hard-coded color for a sky or sun at a known physical temperature. Copy the hex from this tool directly into your shader as the light color.
Remember the inverted convention: a bulb marketed as “warm white” at 2700K is physically cooler than 6500K daylight. The warmer the visual appearance, the lower the Kelvin number — the opposite of everyday temperature language.