The following is a message I received in my email box:
[quote]
john welch :
> Hi. I just tried out your color mixing applet. I changed the three ovals to these values:
> 100,100,55
> 100,55,100
> 55,100,100
>
> I wanted to show students that you didn't have to add 3 monochromatic sources to get white.
> But it looks like the applet is averaging the values rather than adding them, so that in the center of these three ovals I get 119, 119,199, where I would expect 255,255,255.
> I know you don't want to go over 255, but could you do something like max(a+b+c, 255) ?
> Actually, I guess that would distort the color balance if one of the rgb's was cut off at 255 and the other's weren't.
> So how about a scaling factor, like:  taking the maximum value of the sum of the individual rgb's then scaling that down to 255 if it goes over, and applying that scaling factor to all the other sums.
> for example:
>
> max value= max(ar+br+cr, ag+cg+cg, ab+bb+cb)
> if max_value > 255 then scale_factor = 255/max_value
> else scale factor =1
>
> red_value = (ar+br+cr) * scale_factor
> green_value = (ag+bg+cg) * scale factor
> etc
>
> what do you think?
>

[/quote]

In the world of computer, everything is done in binary form.
And that is how the above applet works.
The Red,Green, Blue value will be shown in (R,G,B), i.e. (255,0,0) means red light
For example: For mixing light beams, it not adding the decimal value or binary value to give us the sum (final color value). It is a (OR) operation between two (or more) binary values.

[list]
[li] (255,0,0)+(0,255,0)=(255,255,0) : Most of us will not have problem with this, because red + green will give us yellow light.
In binary term: it is (1111 1111,0000 0000,0000 0000) OR (0000 0000,1111 1111,0000 0000) = (1111 1111,1111 1111,0000 0000)
[/li]
[li](255,0,0)+ (255,0,0) = (255,0,0) : Two red lights emitted at the same place will give us red light.
So the result is not the algebra sum of decimal values.
In binary term: it is  (1111 1111,0000 0000, 0000 0000) OR (1111 1111,0000 0000, 0000 0000) = (1111 1111,0000 0000,0000 0000)
[/li]
[li](64,64,64)+(64,64,64)=(64,64,64) : The same light mixing together, what is changing is the light intensity (not the color)
In binary term: it is (0100 0000,0000 0000, 0000 0000) OR (0100 0000,0100 0000,0100 0000)= (0100 0000,0100 0000, 0100 0000)
[/li]
[li](64,64,64)+(32,32,32)=(92,92,92) : Because it is a sum of two different color, so the final color is different
In binary term: it is (0100 0000,0100 0000,0100 0000) OR (0010 0000,0010 0000,0010 0000)= (0110 0000,0110 0000, 0110 0000)
[/li]
[/list]

I hope the above examples, will help most of you understand how this applet works.
And it is also the same way, how our vision about color works.
The following information are from the above page.
[quote]
Four kinds of light-sensitive receptors are found in the retina:

* rods
* three kinds of cones, each "tuned" to absorb light from a portion of the spectrum of visible light
o cones that absorb long-wavelength light (red)
o cones that absorb middle-wavelength light (green)
o cones that absorb short-wavelength light (blue)
Cone Vision

Although cones operate only in relatively bright light, they provide us with our sharpest images and enable us to see colors. Most of the 3 million cones in each retina are confined to a small region just opposite the lens called the fovea. So our sharpest and colorful images are limited to a small area of view. Because we can quickly direct our eyes to anything in view that interests us, we tend not to be aware of just how poor our peripheral vision is.

The three types of cones provide us the basis of color vision. Cones are "tuned" to different portions of the visible spectrum.

* red absorbing cones; those that absorb best at the relatively long wavelengths peaking at 565 nm
* green absorbing cones with a peak absorption at 535 nm
* blue absorbing cones with a peak absorption at 440 nm.

Retinal is the prosthetic group for each pigment. Differences in the amino acid sequence of their opsins accounts for the differences in absorption.

The response of cones is not all-or-none. Light of a given wavelength (color), say 500 nm (green), stimulates all three types of cones, but the green-absorbing cones will be stimulated most strongly. Like rods, the absorption of light does not trigger action potentials but modulates the membrane potential of the cones.
[/quote]

Because there are three different color censors in our eye. It is the combination of those signals help us interpret the color of any object. For the color: It is similar to the logical OR operation in computer term.