The RGB Model

If you look carefully at the visual spectrum shown to the left you will observe that it appears to be composed of bands in the primary colors: blue, green and red. This is the basis for the R(ed)G(reen)B(lue) model for color - currently the model most widely supported by web browsers.
It is worth noting that it would actually be more logical to talk of the BGR model representing the three primary colors in ascending order of wavelength. This is in fact the way Windows treats color. Thus the windows color #FF0000 actually corresponds to the CSS color #0000FF.

RGB is an additive color model. Computer monitors use RGB. We begin with a surface - the screen - that is black (i.e. emits no light) and then generating the three primary colors in order to create a color display. Intermediate colors are produced as a result of varying the intensities of the three primary colors. For instance, in the figure adjacent the intersection of the green and red circles yields a yellow.
Individual colors in this model are almost universally expressed as a number in the range 0..255.