There are several color atlases for assignment of colors.
The best known is the Munsell atlas, containing colors sorted according color shades, clearness and brightness.
In the decomposition of a color into components (e.g. using a prism) we can recognize clear colors from blue through to red.

We know 6 basic areas of color:

- magneta - M
- blue - B
- cyan - C
- green - G
- yellow - Y
- red - R

Using these primary colors, we can create the majority of other colors.
If we use three primary colors: red, green and blue, then we speak about **additive RGB model**.
If we use cyan, magenta, and yellow, we speak about subtractive **CMY model**.

The basics of the RGB model is the additive composition of red, green and blue colors. This model is used for color monitors. Other colors are expressed by additive superposition of these primary colors using weighted addition of individual components. The higher the value of these primary colors the brighter the resulting color. The RGB model can be represented by a unit cube located in the origin of the coordinate system. Individual axes of the coordinate system represent amplitudes of relevant color components present in the given resulting color. The origin of the coordinate system represents black color, and the corner (1, 1, 1) represents white color. In practice, the unit cube is split into smaller parts, most often into 256 parts (8 bits), so the intensity of every point of an image point can be described by 24 bits (true color).

The primary colors here are: cyan(C), magenta(M) and yellow(Y).
This model is based on a painter's blending of color.
Through adding values of individual color elements we obtain a darker hue of color, the so-called subtractive
blending of colors. Similarly as in the case of the RGB model, also the CMY model can be described using
a unit cube located in the coordinate system with the origin (0, 0, 0), representing white; and the point (1, 1, 1)
representing black.

Subtractive blending is suitable for printing purposes, in particular for ink printers where is applied
the CMYK model, also with a supplement of black. This is because in printing the colors are not in
fact blended, but coated consecutively. However, such a process is not suitably precise and in the
course of printing black we instead obtain a dark brown. Therefore, there is some extra black color
added here, or it is in a separate toner, and specially printed.

The conversion from RGB into CMY is as follows:

[ c ] [ 1 ] - [ r ] [ m ] = [ 1 ] - [ g ]. [ y ] [ 1 ] - [ b ]

These models are most suitable for intuitive perception of colors.
The main parameters are:** hue** of color,** saturation** of color, **brightness**
value or** V-value**.
**Hue** represents the prevailing spectral color, **saturation** represents admixture of other, and
**brightness** corresponds to the amount of white, color-free light. For area projection we use
regular hexagonal pyramid with the top in the origin of the coordinate system. In the other
corners are located the primary colors: Red, Green, Blue, Cyan, Magenta and Yellow.

A shortcoming of this model is its triangle shape with the result that a point with constant brightness

The primary colors are X, Y, Z.

Conversion from RBG to XYZ and back

** X = 2,7689R + 1,7518G + 1,1302B**

** Y = 1,0000R + 4,5907G + 0,0601B**

** Z = 0,0000R + 0,0565G + 5,5943B**

If we want to *normalize* colors (to meet: x+y+z=1), we use the following method:
** ** ** X
Y
Z
x = ---------- x = ----------
x = ----------
X+Y+Z
X+Y+Z
X+Y+Z**

**CIE diagram**
(CIE is an abbreviation of international commission for lighting)
A curve representing clear white. White color is obtained through the superposition of all other colors in the center.

Color ranges are represented by abscissas, while all points of an abscissa are obtained through the additive superposition of such colors (it is a color transit from A color to B color). Similarly, in the case of a CDE triangle, where internal points of this triangle are obtained via combinations of the corner primary color C, D, E. When looking at a CIE diagram, it can be seen that we cannot construct a triangle covering it wholly. From this is implied that it is not possible to find the same 3 primary colors which could determine all colors.

Conversion of RGB to YUV

YUV can be obtained from RGB in this way:

[ Y ] = [ 0.299 0.587 0.114 ] [ R ] [ U ] = [ -0.141 -0.289 0.437 ] [ G ] [ V ] = [ 0.615 -0.515 -0.100 ] [ B ]

This color model is defined in accordance with CCIR 601 (256 levels).

Conversion YCbCr

Y, Cb, Cr are converted from RGB in accordance with the determination CCIR Recommendation 601,
but are normalized so as to get 256 values of 8-bit binary coding

More precisely as follows :

Y = 256 * E'Y Cb = 256 * [ E'Cb ] + 128 Cr = 256 * [ E'Cr ] + 128

where E'Y, E'Cb and E'Cb are defined as in CCIR 601. The value E'Y is from the range from 0 to 1.0 and the values E'Cb and E'Cb from the interval 0.5 to +0.5.

Conversion of RGB to YCbCr

YcbCr (256 values) can be directly changed from 8-bit RGB in the following way:

** Y = 0.299 R + 0.587
G + 0.114 B
Cb = - 0.1687 R - 0.3313 G + 0.5
B + 128
Cr = 0.5 R - 0.4187
G - 0.0813 B + 128**

Conversion of YCbCr to RGB

RGB can be obtained from YcbCr (256 values) in the following way:

** R = Y
+ 1.402 (Cr-128)
G = Y - 0.34414 (Cb-128) - 0.71414 (Cr-128)
B = Y + 1.772 (Cb-128)
**

Copyright (c) 1999-2017 Juraj Štugel. www.netgraphics.sk