Primary color

Primary colors (or primary colours in Commonwealth English) are sets of colors that can be combined to make a useful range of colors. The primary colors are those which cannot be created by mixing other colors in a given color space.
For subtractive combination of colors, as in mixing of pigments or dyes for printing, the CMYK set of primaries is often used. In this system the primary colors are cyan, magenta,and yellow. Other sets include the RYB system of red, yellow, blue, especially used by artists.
For additive combination of colors, as in overlapping projected lights or in television and computer screens, the primary colors normally used are red, green, and blue.
Biological basis
Primary colors are not a fundamental property of light but are related to the physiological response of the eye to light (the way the eye works). For humans, three primary colors are usually used, since human color vision is trichromatic.
Fundamentally, light is a continuous spectrum of the wavelengths that can be detected by the human eye, an infinite-dimensional stimulus space. However, the human eye normally contains only three types of color receptors, called cone cells. Each color receptor respond to different ranges of the color spectrum. Humans and other species with three such types of color receptors are known as trichromats.
The additive primaries are red, green,
and blue. Because of the response curves of the three different color receptors in
the human eye, these colors are optimal in the sense that the largest range
of colors -- a gamut -- visible by humans can be generated by mixing light of these colours.
Additive mixing of red and green light, produce shades of yellow or orange. Mixing green and blue produces shades of cyan, and mixing red and blue produces shades of purple and magenta. Mixing equal proportions of the additive primaries results in shades of grey; when all three colors are fully saturated, the result is white. The color space that is generated is called the RGB ("red, green, blue") color space.
Subtractive primaries
Media that use reflected light and colorants to produce colors are using the subtractive color method of color mixing. In the printing industry, to produce the varying colors, apply the subtractive primaries yellow, cyan, and magenta together in varying amounts. Subtractive color works best when the surface or paper, is white, or close to it.
Mixing yellow and cyan produces shades of green; mixing yellow with magenta produces shades of red, and mixing magenta with cyan produces shades of blue. In theory, mixing equal amounts of all three pigments should produce shades of grey, resulting in black when all three are fully saturated, but in practice they tend to produce muddy brown colors. For this reason, a fourth "primary" pigment, black, is often used in addition to the cyan, magenta, and yellow colors.
The color space generated is the so-called CMYK color space. The abbreviation stands for "Cyan, Magenta, Yellow, and Black" -- K stands for "Kohle" (German for coal) and is used to represent black as 'B' could be confused with 'Blue'.
In practice, mixtures of actual materials like paint tend to be less precise. Brighter, or more specific colors can be created using natural pigments instead of mixing, and natural properties of pigments can interfere with the mixing. For example, mixing magenta and green in acrylic creates a dark cyan - something which would not happen if the mixing process were perfectly subtractive.