💡 Kelvin to RGB Converter
Convert color temperature (Kelvin) to precise RGB values with visual preview & hex code
| Light Source | Kelvin (K) | Red (R) | Green (G) | Blue (B) | Hex Code | Character |
|---|
| Temperature Range | Red Channel | Green Channel | Blue Channel | Visual Appearance |
|---|---|---|---|---|
| 1000K – 2000K | 255 (max) | 60 – 109 | 0 | Deep orange / red glow |
| 2000K – 3000K | 255 (max) | 109 – 168 | 0 – 35 | Warm amber / gold |
| 3000K – 4000K | 255 (max) | 168 – 209 | 35 – 117 | Warm white / yellow-white |
| 4000K – 5500K | 255 (max) | 209 – 244 | 117 – 232 | Neutral to cool white |
| 5500K – 7000K | 217 – 255 | 244 – 255 | 232 – 255 | Cool white / blue-white |
| 7000K – 12000K | 130 – 217 | 180 – 222 | 255 (max) | Blue / icy blue sky |
| Format | Example (5500K Daylight) | Use Case | Precision |
|---|---|---|---|
| rgb(R, G, B) | rgb(255, 232, 213) | CSS / Web | 0 – 255 |
| Hex #RRGGBB | #FFE8D5 | CSS / Design tools | 00 – FF |
| rgba(R, G, B, A) | rgba(255, 232, 213, 1.0) | CSS with opacity | Alpha 0.0 – 1.0 |
| Normalized (0–1) | 1.0, 0.91, 0.84 | OpenGL / Shader | 0.0 – 1.0 |
| 16-bit | 65535, 59166, 54484 | HDR / Color grading | 0 – 65535 |
Convert temperature in Kelvin to colour RGB happens more often than one could imagine. There are programs designed specially for that task. The idea itself is simple: one takes the colour of the temperature measured by means of Kelvin, and changes it to values for red, green and blue, that work for screen or LED-lights.
Testing of RGB LED-strips is one typical use. Someone maybe wants to set his LED-strip to a warm or cold white light, and for that needs the right RGB-values for that Kelvin-temperature. Tables for research can help in such case.
How to Convert Kelvin to RGB
For sample, at 1000 Kelvin the RGB-value is about (255, 56, 0), what gives strong hot orange. At 1600 Kelvin it changes to (255, 115, 0). At 2000 Kelvin, a bit of blue shows up, at (255, 138, 18).
The model goes upward through the range, while teh colours slowly change.
Access tables that assign values of Kelvin to colours RGB. Some of them follow the functions of colour match CIE from 1964, that gives a rough picture of how colour temperature becomes RGB. The needs for temperatures sit between 1000 and 40000 degrees, sew that the conversion works well.
A package in npm called kelvin-to-rgb is available for coders, that want to do that in code. It exists for around 11 years, and 21 other projects in the npm system depend on it. Another package called kolor-temperature acts the same, with 17 projects that use it.
Using the package kelvin-to-rgb is fairly easy. One puts in a value of Kelvin, for instance 1600, and gets a set with values for red, green and blue.
Some programs convert Kelvin not only to RGB, but also to HEX, HSL and other forms of colours. The converter for colour temperature can give RGB-values either in range 0-1 or 0-255. There are also Arduino-libraries for converting temperature in Kelvin and brightness to values RGB, what is useful for home projects.
Going in the other way, from RGB back to Kelvin, is actually much more complex. Almost all RGB-values do not allow reliable conversion to temperatures Kelvin. For instance, pure green as 0x00ff00 does not have an equal colour temperature, so that the result would be poor.
Working with RGBW-lights, some use the white part alone and later set it by means of adding a bit of blue to cool down or a bit of red or yellow to heat up, what changes the feeling of Kelvin. Some controls for light have built-in samples, that show the rough match of Kelvin, that the light will give. Programs for RGB, meant for players, usually do not carry a choice of Kelvin, because players less need purewhite light, what makes that useless for them.
