Which colors are considered primary depends on whether the method being used is additive or subtractive. Additive primary colors are red, blue and green. Subtractive primary colors are magenta, cyan and yellow.
Additive colors can be thought of as light being emitted from a source. Sunlight, for example, is white because light of different wavelengths have been layered, or added, together to create a full spectrum. Adding red, green and blue light together generates white light.
Subtractive colors work by absorbing light of various frequencies. Magenta, cyan and yellow, when mixed together as pigments, produce black. By varying their relative concentrations, however, it is possible to produce ink or dye of any color.