# What {R,G,B} values would represent a 445nm monochrome lightsource color on a computer monitor?

Is it possible to answer my question definitely (assuming the monitor is perfect)? What would be the formula for calculating RGB values for a visible monochrome light with given wavelength?

• A good article on the subject, demonstrating how not all visible colors can be represented nor reproduced as {R, G, B}: jamie-wong.com/post/color – Violet Giraffe Apr 17 '18 at 13:08

First you consult a CIE 1964 Supplementary Standard Colorimetric Observer chart, and look up the CIE color matching function values for the wavelength you want:

For your desired wavelength:

| λ   | CIE color matching functions  |  Chromacity coordinates     |
| nm  |     X    |     Y    |    Z    |    x    |    y    |    z    |
|-----|----------|----------|---------|---------|---------|---------|
| 455 | 0.342957 | 0.106256 | 1.90070 | 0.14594 | 0.04522 | 0.80884 |


Note: The chromacity coordinates are simply calculated from the CIE color matching functions:

x = X / (X+Y+Z)
y = Y / (X+Y+Z)
z = Z / (Z+Y+Z)


Given:

X+Y+Z = 0.342257+0.106256+1.90070 = 2.349913


We can calculate:

x = 0.342257 / 2.349913 = 0.145945
y = 0.106256 / 2.349913 = 0.045217
z = 1.900700 / 2.349913 = 0.808838


You have a color specified using two different color spaces:

• XYZ = (0.342957, 0.106256, 1.900700)
• xyz = (0.145945, 0.045217, 0.808838) (which matches what we already had in the table)

We can also add a third color space: xyY

x = x = 0.145945
y = y = 0.045217
Y = y = 0.106256


We now have the color specified in 3 different color spaces:

• XYZ = (0.342957, 0.106256, 1.900700)
• xyz = (0.145945, 0.045217, 0.808838)
• xyY = (0.145945, 0.045217, 0.106256)

So you've converted a wavelength of pure monochromatic emitted light into a XYZ color. Now we want to convert that to RGB.

## How to convert XYZ into RGB?

XYZ, xyz, and xyY are absolute color spaces that describe colors using absolute physics.

Meanwhile, every practical color spaces that people use:

• Lab
• Luv
• HSV
• HSL
• RGB

depends on some whitepoint. The colors are then described as being relative to that whitepoint.

For example,

• RGB white (255,255,255) means "white"
• Lab white (100, 0, 0) means "white"

But there is no such color as white. How do you define white? The color of sunlight?

• at what time of day?
• with how much cloud cover?
• at what latitude?
• on Earth?

Some people use the white of their (horribly orange) incandescent bulbs to mean white. Some people use the color of their florescent lights. There is no absolute physical definition of white - white is in our brains.

## So we have to pick a white

We have to pick a white. Really it's you who has to pick a white. And there are plenty of whites to choose from:

I will pick a white for you. The same white that sRGB uses:

• D65 - daylight illumination of clear summer day in northern Europe

D65 (which has a color close to 6500K, but not quite because of the Earth's atmosphere), has a color of:

• XYZ_D65: (0.95047, 1.00000, 1.08883)

With that, you can convert your XYZ into Lab (or Luv) - a color-space equally capable of expressing all theoretical colors. And now we have a 4th color space representation of our 445 nm monochromatic emission of light:

• XYZ: (0.342957, 0.106256, 1.900700)
• xyz: (0.145945, 0.045217, 0.808838)
• xyY: (0.145945, 0.045217, 0.106256)
• Lab: (38.94259, 119.14058, -146.08508) (D65)

## But you want RGB

Lab (and Luv) are color spaces that are relative to some white-point. Even though you were forced to pick an arbitrary white-point, you can still represent every possible color.

RGB is not like that. With RGB:

• not only is the color relative to some white-point
• but is is also relative to three color primaries: red, green, blue

If you specify an RGB color of (255, 0, 0), you are saying you want "just red". But there is no definition of red. There is no such thing as "red", "green", or "blue". The rainbow is continuous, and doesn't come with an arrow saying:

This is red

And again this means we have to pick three pick three primary colors. You have to pick your three primary colors to say what "red", "green", and "blue" are. And again you have many different definitions of Red,Green,Blue to choose from:

• CIE 1931
• ROMM RGB
• Adobe Wide Gamut RGB
• DCI-P3
• NTSC (1953)
• Apple RGB
• sRGB
• Japanese NTSC
• PAL/SECAM
• Adobe RGB 98
• scRGB

I'll pick for you. I'll pick these three colors:

• Red: xyY = (0.6400, 0.3300, 0.2126)
• Green: xyY = (0.3000, 0.6000, 0.7152)
• Blue: xyY = (0.1500, 0.0600, 0.0722)

Those were also the primaries chosen for by an international committee in 1996.

They created a standard that said everyone should use:

• Whitepoint: D65 daylight (0.95047, 1.00000, 1.08883)
• Red: (0.6400, 0.3300, 0.2126)
• Green: (0.3000, 0.6000, 0.7152)
• Blue: (0.1500, 0.0600, 0.0722)

And they called that standard sRGB - and you can see these four points plotted out on a chromacity diagram:

sRGB Chromacity Diagram (D65 & red,green,blue primaries)

# The final push

Now that we have chosen our

• white-point
• three primaries

we can now convert you XYZ color into RGB, using the sRGB choices for "red", "green", "blue", and "white":

/*
The matix values in the next step depend on location of RGB in the XYZ color space.
These constants are for
Observer:          2°
Illuminant:        D65
RGB Working Space: sRGB
*/
r = X *  3.2404542 + Y * -1.5371385 + Z * -0.4985314;
g = X * -0.9692660 + Y *  1.8760108 + Z *  0.0415560;
b = X *  0.0556434 + Y * -0.2040259 + Z *  1.0572252;


Giving you your RGB of:

• RGB = (1.47450, -65.7629, 345.59392)

Unfortunately:

• your monitor cannot display negative green (-65). It means it is a color outside what your monitor can display (i.e. outside of its color gamut)
• your monitor cannot display more blue than 255 (345). It also means that it's a color outside your monitor's gamut.

So we have to round:

• XYZ = (0.342957, 0.106256, 1.900700)
• xyz = (0.145945, 0.045217, 0.808838)
• xyY = (0.145945, 0.045217, 0.106256)
• Lab = (38.94259, 119.14058, -146.08508) (Whitepoint: D65)
• RGB - (1, 0, 255) (sRGB)

# Bonus - Where you color is

I wanted to point out that nearly everyone uses sRGB as the standard. It's a general standard for all digital cameras, for JPEGs on the Internet, and computer monitors. The goal is that every one of these devices agree on:

• the color of the red primary
• the color of the green primary
• the color of the blue primary
• the color that we will use as white

And those places outside the triangle on the sRGB chromacity diagram are still all valid colors; your monitor just can't display them.

And the very outside edge of the curve (called the locus) is the location of different pure frequencies of monochromatic light. That is where your pure 445nm monochromatic light source would be:

• All this good stuff (I assume) basically leads to the "intuitive" "just blue", maybe you could add that as a TL;DR at the beginning. – Jasper Jul 27 '18 at 5:29
• If you like simple answers: A computer monitor can not produce a monochromatic light of 445nm. That's also the essence of the above, but there are also "metameres" (color look-alikes). – U. Windl Nov 22 '19 at 23:22
• @Ian Boyd Why is the white point important for light emitters (like a monitor is)? Adaption of the eye? But that would probably apply to the original wavelength as well... – U. Windl Nov 22 '19 at 23:31
• @U.Windl The white-point is important for two reasons. i) when creating other color spaces, it's more space efficient (and intuitively understandable) to represent a color as relative to white. The problem is that there is no universally agreed definition of white. In fact, if i put you in a room with incandescent tungsten lights, and you look at a piece of plain paper, you'll swear it is white (even though it's orange). This is the 2nd reason: the brain adapts to the surrounding light and calls it white. And then everything else will be relative to that surrounding white point. – Ian Boyd Nov 23 '19 at 2:01
• @IanBoyd I tend to disagree a bit: Some color spaces are relative to white (e.g. L*a*b* and L*u*v*), but others are not (e.g. Yxy, Lu'v', RGB, and XYZ). The OP was asking for RGB, so the white point should play no role. If I'm wrong, please explain. – U. Windl Nov 24 '19 at 21:00

You can use http://rohanhill.com/tools/WaveToRGB/index.asp to convert a wavelength to rgb.

If your interest lies more in what the formula actually is, this would illustrate it
(source: sfasu.edu)

As you see there's not really an exact formula - they use the approximation in that image.

• I don't actually see the formula on that 2nd link, could you be more specific? – Kyle Kanos Jan 19 '14 at 16:42
• Updated with some more info - I meant to link to the code examples – Kvothe Jan 19 '14 at 16:59
• Well, you can place any wavelength on a tristumulus chart (see Wikipedia for examples and links), and there are a number of derived algorithms for converting among RGB, HSV, lambda, etc. – Carl Witthoft Jan 19 '14 at 17:23
• The link is no longer accessible. – Violet Giraffe Jan 3 '16 at 13:21

There is no way to display a monochromatic light on a RGB monitor: RGB-value is a mixture of three light sources, it cannot be monochromatic by definition even if R, G and B components are monochromatic themselves.

Look at the famous CIE 1931 chromaticity diagram that shows the space of all colors we can see compared to a gamut of a typical monitor. Monochromatic light is the boundary of the color space and the tool in Bruno's answer calculates the closest color within the triangle of RGB values. You can see that for 455 nm this approximation is quite close, whereas green light (like 510 nm) is really far away from what RGB monitor can display.

Edit: as MSalters pointed out, the distance on the CIE 1931 diagram should not be interpreted as difference of two colors as the diagram strongly exaggerates green tones. Other color spaces have been designed where the distance on of two points corresponds to perceived color difference. One of them is CIELUV (L* u* v*) and in this space it doesn't look that green colors are displayed worse than reds or blues.

• What my question asks is what RGB color recreates perceived color of a given monochromatic light. But thanks for the picture, I didn't realize a monitor's gamut is that small. – Violet Giraffe Jan 20 '14 at 10:50
• @VioletGiraffe: Don't be deceived. Look at the numbers along the edge. On the bottom, 10 nm is about 1 scale unit, but between 490 and 500 nm it's 5 scale units. And the "biggest" unrepresented area lies near the 500 nm mark. The cause of this is a particular choice of {x,y} coordinates. – MSalters Jan 22 '14 at 12:48
• @MSalters: thank you, I missed this point and I will update my answer. – gigacyan Jan 22 '14 at 13:24

Humans have three kinds of cones, which are photoreceptor cells, for color vision in our retina. They can be characterized by their spectral sensitivity, which gives a relative response intensity as a function of wavelength, and which is approximately the same for each individual. The following image gives an average shape for each cone type:

The response to light of a given spectral distribution is fully determined by the triple of values obtained by integrating the product of the spectral distribution with the cone response. If you do this for the spectrum of monochromatic light of 445 nm wavelength, which is a multiple of a delta function, you get a triple $(s,m,l)$, where $s$ will be much larger than the other two (in this case).

If you do the same for the three kinds of dots your screen is built up of, you get three values for each of them as well. By linear algebra you get a unique linear combination that should reproduce your monochromatic source for as far as human perception is concerned. However, you may very well get negative coefficients. In this case the value is outside the gamut of the monitor.

Finally, the values you have to send to the monitor are not directly these coefficients. From your input to the light intensities there are all kinds of transformations involved. In the best of cases you can specify the values in some standardized colour space, like Lab, XYZ or sRGB. Transformation between these color spaces and the space of cone responses of the average observer is standardised (though not uniquely), see e.g. wikipedia.

Well the R and G values would both be zero, and you would have to have a 445nm dominant wavelength blue phosphor or back light source (LED).

Well you can't find that on your computer monitor, as the blue LEDs are more like 460-470 nm.

So there is no solution.