Complementary color
Complementary colors are colors related by the fact that light reflected by objects of one color is absorbed by those of the other. In consequence, in an additive color mix of the two produces pure white, and a subtractive color mix of the two produces pure black.
The best way to tell which colors are complementary is to look at a color wheel--the complementary colors will be opposite one another. For example, orange and blue are complementary, as are red and green and purple and yellow. The use of complementary colors is an important aspect of aesthetically pleasing art and graphic design.
Complements in RGB color spaces
In an RGB color space, a color can be represented as an ordered triple (R,G,B) of color coordinates. Let (0,0,0) represent black, and (1,1,1) represent white. Then, given a color (R,G,B), its complement will be (1 − R, 1 − G, 1 − B). This way, when the two complementary colors are added, the result is pure white: