The electromagetic spectrum
ROY G BIV acronym
The following is a potential spectral energy distribution of light reflecting from a green wall.


There are three types of cones, referred to either as B, G, and R, or
equivalently as S, M, and L, respectively. Their peak sensitivities are located
at approximately 430nm, 560nm, and 610nm for the "average" observer. Animals
exist with both fewer and more types of cones. The photopigments in rods and
cones are stimulated by absorbed light, yielding a change in the cell membrane
potential. The different types of cells have different spectral sensitivies:
In order to define the perceptual 3D space in a "standard" way, a set of
experiments can (and have been) carried by having observers try and match colour
of a given wavelength, lambda, by mixing three other pure wavelengths, such as
R=700nm, G=546nm, and B=436nm in the following example. Note that the phosphours
of colour TVs and other CRTs do not emit pure red, green, or blue light of a
single wavelength, as is the case for this experiment.
The above scheme can tell us what mix of R,G,B is needed to reproduce the perceptual equivalent of any wavelength. A problem exists, however, because sometimes the red light needs to be added to the target before a match can be achieved. This is shown on the graph by having its intensity, R, take on a negative value.
In order to achieve a representation which uses only positive mixing
coefficients, he CIE ("Commission Internationale d'Eclairage") defined three new
hypothetical light sources, x, y, and z, which yield positive matching
curves:
If we are given a spectrum and wish to find the corresponding X, Y, and Z
quantities, we can do so by integrating the product of the spectral power and
each of the three matching curves over all wavelengths. The weights X,Y,Z form
the three-dimensional CIE XYZ space, as shown below.
Often it is convenient to work in a 2D colour space. This is commonly done by
projecting the 3D colour space onto the plane X+Y+Z=1, yielding a CIE
chromaticity diagram. The projection is defined as:
The chromaticity diagram looks as follows.

A few definitions:



The colour cube sits within the CIE XYZ colour space as follows.

| dye colour | absorbs | reflects |
| cyan | red | blue and green |
| magenta | green | blue and red |
| yellow | blue | red and green |
| black | all | none |
To produce blue, one would mix cyan and magenta inks, as they both reflect blue while each absorbing one of green and red. Unfortunately, inks also interact in non-linear ways. This makes the process of converting a given monitor colour to an equivalent printer colour a challenging problem.
Black ink is used to ensure that a high quality black can always be printed, and is often referred to as to K. Printers thus use a CMYK colour model.
yields the colour on monitor 2 which is
equivalent to a given colour on monitor 1. Quality conversion to-and-from
printer gamuts is difficult. A first approximation is shown on the left. A
fourth colour, K, can be used to replace equal amounts of CMY, as shown on the
right. K = min(C,M,Y) C = 1 - R C' = C - K M = 1 - G M' = M - K Y = 1 - B Y' = Y - K