How CGA color works
The IBM Color Graphics Adapter (1981) is simple hardware with a surprising amount of subtlety — and it's the subtlety that nearly every "retro palette" reference gets wrong. Here's what actually happens, from the 4-bit digital signal to the analog composite artifacts.
RGBI: four bits, sixteen colors
CGA's digital output has exactly four wires: R, G, B, and I (intensity). Four bits give 16 combinations — the 16 CGA colors. The mapping to actual brightness is straightforward: a primary that's "on" without intensity sits at about two-thirds level (0xAA = 170), and the intensity bit lifts the whole color by roughly one-third (0x55 = 85). So an "off" channel becomes 85 when intensity is set, and an "on" channel jumps to 255.
That's why dark gray is #555555 (intensity only, all primaries off → 85,85,85) and light blue is #5555FF (intensity + blue → 85,85,255). Every one of the 16 falls out of this rule — except one.
#AAAA00 — dark yellow. IBM thought that looked bad, so the 5153 monitor contains a circuit that halves the green component for this one color, turning it into brown #AA5500. Clone monitors without that circuit showed dark yellow, and the retro community still argues about it. See the CGA palette page, which lets you toggle between the two.
Graphics modes: you don't get a free palette
In text mode all 16 colors are available. In graphics mode they are not freely choosable — and this is the second thing references get wrong.
320×200, 4 colors: each pixel is 2 bits. One of the four entries (the background) is freely chosen from all 16 RGBI colors. The other three come as a fixed group selected by two hardware bits — a palette-select bit (palette 0 = green/red/brown, palette 1 = cyan/magenta/white) and an intensity bit (dim vs. bright versions). There's also an officially undocumented mode 5 that exposes a third group (cyan/red/white). You can explore every combination in the CGA mode simulator.
640×200, 2 colors: one bit per pixel — a background and a single foreground. Higher resolution, less color.
Two outputs, two very different pictures
The CGA card has two physical outputs, and they don't show the same thing:
- RGBI (the 9-pin digital connector) drives an RGB monitor like the 5153. Sharp pixels, the 16 colors above, no surprises.
- Composite (the RCA jack) emits a single analog NTSC signal for a TV — and on a TV, the colors change completely.
Composite artifact colors: the real magic
Here's the key fact: CGA's pixel clock is 14.31818 MHz, which is exactly four times the NTSC color subcarrier of 3.579545 MHz. That 4:1 ratio is not a coincidence of convenience — it means a horizontal run of on/off pixels, emitted at the pixel clock, is electrically indistinguishable to a TV from a chroma subcarrier. The TV interprets it as color.
Specifically, within each group of four pixels (one subcarrier cycle): the phase of the pattern becomes hue, the amplitude becomes saturation, and the average level becomes brightness. A repeating dot pattern therefore is a color — one that may not exist among the 16 RGBI colors at all. In 640-pixel mode there are 16 distinct four-pixel patterns, yielding the classic ~16 artifact colors (the muddy browns, the artifact orange and blue, the grey you get from alternating pixels).
So which CGA colors are "right"?
All of them — it depends on the output and the monitor. The 16 RGBI colors are right for an RGB monitor (with the brown/dark-yellow split depending on the 5153 circuit). The artifact colors are right for a composite TV. A good tool models the hardware path rather than picking one answer and calling the others wrong. That's the whole idea behind this site.
Frequently asked
- How many colors can CGA show at once?
- 16 in text mode; 4 in 320×200 graphics (background + a fixed 3-color group); 2 in 640×200. On composite, dot patterns produce additional artifact colors beyond the 16.
- Is composite color "real" color or a trick?
- It's real in the sense that a TV genuinely displays it — but it's an artifact of how NTSC encodes color, not a palette the programmer selected directly. Developers learned to exploit it deliberately.
- Where can I see the exact values?
- The CGA, EGA, and VGA reference pages list every hex code; the simulator and converter show them live.