Applet Only -- Mixing Colors Algebraically

The applet on the right illustrates some of the power of vector spaces.

Notice the large white triangle. This applet uses the correspondence between colors and geometry produced by vector spaces to let you choose different colors for the triangle. You can place a dot anyplace inside the triangle by moving your mouse and pressing the mouse button. Notice when you move the dot the color of the triangle changes.

We saw in the last module that each point in the triangle can be represented in the form

P = a A + b B + c C

where

a + b + c = 1

and the three coefficients a, b, and c are between zero and one.

Most computers and operating systems represent colors by vectors of the form (R, G, B) in which the three components represent the intensity of red, green, and blue, respectively. None of these components can be negative and one usually represents the maximum intensity for each color on the monitor. Thus, R, G, and B are all between zero and one. The colors of the three vertices are represented by the vectors

R = (1, 0, 0)
G = (0, 1, 0)
B = (0, 0, 1)

When you place the dot at the point represented by the vector

P = a A + b B + c C

where A represents the red vertex; B represents the green vertex; and B represents the blue vertex and

a + b + c = 1

and the three coefficients a, b, and c are between zero and one the triangle is colored using the color

a R + b G + c B


Copyright c 1995 by Frank Wattenberg, Department of Mathematics, Montana State University, Bozeman, MT 59717