Also see palette.
RGB (red, green, and blue) refers to a system for representing the colors to be used on a computer display. Red, green, and blue can be combined in various proportions to obtain any color in the visible spectrum. Levels of R, G, and B can each range from 0 to 100 percent of full intensity. Each level is represented by the range of decimal numbers from 0 to 255 (256 levels for each color), equivalent to the range of binary numbers from 00000000 to 11111111, or hexadecimal 00 to FF. The total number of available colors is 256 x 256 x 256, or 16,777,216 possible colors.
In the Hypertext Markup Language (HTML), the color for a page background or text font is specified by an RGB value, expressed with six digits in hexadecimal format. The first and second digits represent the red level; the third and fourth digits represent the green level; the fifth and sixth digits represent the blue level. In order to actually display the colors for all possible values, the computer display system must have 24 bits to describe the color in each pixel. In display systems or modes that have fewer bits for displaying colors, an approximation of the specified color will be displayed.
In creating Web pages, the number of RGB values that are recommended for use is considerably reduced - first, by the fact that many displays can handle only 256 colors and, secondly, because PC and Mac Web browsers handle 40 of these 256 colors slightly differently. In order to ensure that your colors will be consistent on both browsers, a palette of the 216 colors common to both PC and Web browsers is recommended. Any color outside of these will be dithering (approximated).