Video Graphics Array - The VGA Color Palette

The VGA Color Palette

See also: List of monochrome and RGB palettes, 18-bit RGB, List of 16-bit computer hardware palettes, and MCGA and VGA

The VGA color system is backward compatible with the EGA and CGA adapters, and adds another level of configuration on top of that. CGA was able to display 16 fixed colors, and EGA extended this by allowing each of the 16 colors to be chosen from a 64-color palette (these 64 colors are made up of two bits each for red, green and blue: two bits × three channels = six bits = 64 different values). VGA further extends this scheme by increasing the EGA palette from 64 entries to 256. Two more blocks of 64 colors with progressively darker shades were added, along with eight "blank" entries that were set to black.

In addition to the extended palette, VGA adds a second level of indirection: Unlike EGA's fixed 64-color palette, each of VGA's 256 palette entries could be assigned an arbitrary color value through the VGA DAC. The EGA BIOS only allowed two bits per channel to represent each entry, while VGA allowed six bits to represent the intensity of each of the three primaries (red, blue and green). This provided 64 different intensity levels for each of red, green and blue, resulting in 262,144 possible colors, any 256 of which could be assigned to the palette (and in turn out of those 256, any 16 of them could be displayed in CGA video modes).

This method allowed new VGA colors to be used in EGA and CGA graphics modes, providing one remembered how the different palette systems are laid together. To set the text color to very dark red in text mode, for instance, it will need to be set to one of the CGA colors (for example, the default color, #7: light grey.) This color then maps to one in the EGA palette—in the case of CGA color 7, it maps to EGA palette entry 42. The VGA DAC must then be configured to change color 42 to dark red, and then immediately anything displayed on the screen in light-grey (CGA color 7) will become dark red. This feature was often used in 256-color VGA DOS games when they first loaded, by smoothly fading out the text screen to black. (The game Descent, from 1995, is an example.)

While CGA and EGA-compatible modes only allowed 16 colors to be displayed at any one time, other VGA modes, such as the widely used mode 13h, allowed all 256 palette entries to be displayed on the screen at the same time, and so in these modes any 256 colors could be shown out of the 262,144 colors available.

Read more about this topic:  Video Graphics Array

Famous quotes containing the words color and/or palette:

    The most refined skills of color printing, the intricate techniques of wide-angle photography, provide us pictures of trivia bigger and more real than life. We forget that we see trivia and notice only that the reproduction is so good. Man fulfils his dream and by photographic magic produces a precise image of the Grand Canyon. The result is not that he adores nature or beauty the more. Instead he adores his camera—and himself.
    Daniel J. Boorstin (b. 1914)

    I have heard that hysterical women say
    They are sick of the palette and fiddle-bow,
    Of poets that are always gay,
    William Butler Yeats (1865–1939)