The color representation of VGA
Sep 21, 2026
The VGA color representation uses a register-based palette, mapping various bit-depth colors to the 18-bit output color space. It is backward compatible with the Color Graphics Adapter (CGA) and Enhanced Graphics Adapter (EGA) modes, which support additional bit depths for the palette. For example, in the EGA 16-color mode, VGA provides 16 palette registers, while in the 256-color mode, it provides 256 registers. Each palette register contains a 3×6-bit RGB value, selected from the 18-bit color space of the Digital to Analog Converter (DAC).
These color registers are initialized with the default values that IBM expected to be the most useful in each mode. For instance, the EGA 16-color mode is initialized with the default CGA 16-color palette, while the 256-color mode is initialized with a palette containing 16 CGA colors, 16 gray-scale shadows, and 216 colors selected by IBM to accommodate the expected use cases. After initialization, they can be redefined at any time without changing the content of the video RAM, and allow for palette cycling.
In the 256-color mode, the DAC is set to combine four 2-bit color values, one for each plane, to form an 8-bit value representing the index in the 256-color palette. The CPU interface combines the four planes in the same way, making each pixel a packaged 8-bit value for the CPU to represent the palette index.








