CGA palette: 16 colours with hex codes

Updated · Adib Khan

A small pixel-art character walking, drawn in the CGA palette
The Walk starter with the CGA palette applied: each colour became the nearest one in the palette. Open it in the editor with this palette.

The CGA palette

CGA is the colour graphics standard of the first IBM PCs. Its sixteen colours come from four on-or-off signals: one each for red, green and blue, and one shared intensity bit that brightens all three at once. Three colour bits give eight colours, the intensity bit gives a brighter copy of each, and that makes sixteen. The one exception is colour 6, which is brown instead of dark yellow.

ColourSwatchHexRGB
0, black#0000000, 0, 0
1, blue#0000aa0, 0, 170
2, green#00aa000, 170, 0
3, cyan#00aaaa0, 170, 170
4, red#aa0000170, 0, 0
5, magenta#aa00aa170, 0, 170
6, brown#aa5500170, 85, 0
7, light grey#aaaaaa170, 170, 170
8, dark grey#55555585, 85, 85
9, light blue#5555ff85, 85, 255
10, light green#55ff5585, 255, 85
11, light cyan#55ffff85, 255, 255
12, light red#ff5555255, 85, 85
13, light magenta#ff55ff255, 85, 255
14, yellow#ffff55255, 255, 85
15, white#ffffff255, 255, 255

This page lists the colours in CGA's own order, 0 to 15, which is also the order the editor lists them in.

To use these colours in another program, copy the list. It is one hex code per line, with no hash, which is the shape most palette pasters want.

000000
0000AA
00AA00
00AAAA
AA0000
AA00AA
AA5500
AAAAAA
555555
5555FF
55FF55
55FFFF
FF5555
FF55FF
FFFF55
FFFFFF
Draw something in CGA.Open the editor

About CGA

CGA, the Color Graphics Adapter, arrived in 1981 as the first colour graphics card for the IBM PC. In text mode it showed all sixteen colours. In its 320 by 200 graphics mode it showed only four at a time, picked from a fixed set: cyan, magenta and white, or green, red and brown, on a background colour of your choice. A 640 by 200 mode showed two. Games of the time were drawn with those four, and that look is what many people mean by CGA.

Use it in the editor

The palette is built in, so you do not need to paste anything.

  1. Open the editor and open the palette menu: the three dots at the top of the palette panel.
  2. Choose Built-in palettes, then CGA.
  3. Choose Add to put its colours after the ones you have, or Replace to swap your palette for this one. A line shows what will happen before you commit, for example how many pixels change colour.
  4. Press the button at the bottom. The whole change is one step, so Undo takes it back.
The Import palette dialog in PixelFlipbook with the built-in palettes PICO-8, Game Boy and CGA listed with their colour strips, CGA chosen, Replace selected and a line saying how many pixels change colour
Replace previews the change before you make it. This is the Walk starter, switched to CGA.

The editor cannot take a palette from a link, so the sample above does it another way. Open it in the editor with this palette opens the little walker as your own copy, with the palette already loaded. Clear the canvas or draw over it, and the palette stays. The original is never changed, and each time you open it you get a new project.

How the sample was made

The sample is the Walk starter, which is drawn in the PICO-8 palette. For the other palettes, each colour was swapped for the nearest colour in the new palette, measured as the distance between the two colours in red, green and blue. That is exactly what Replace does in the editor, so the sample shows what you would get, not a touched-up version. Sometimes the nearest colour is not the one you would pick by eye, and that is where you step in and fix a few pixels.

The picture was made at 16 by 16 pixels, with each pixel drawn as a block of 8 by 8 on screen, so the edges are sharp.

Tips for this palette

Where it comes from

These are the 16 colours of the IBM CGA text mode (RGBI), with colour 6 as brown. IBM is a trademark of International Business Machines Corporation, and PixelFlipbook is not affiliated with IBM. CGA is the name of a hardware standard, and its colour values are facts about that hardware, not artwork.

Lospec, the palette site that most pixel artists know, lists many more palettes, each with its author named. Find more at Lospec. The editor's Browse palettes button reads that list directly when you open it, so authors are credited where they published. Palettes from Lospec are not copied onto this site. We found no licence for reuse in Lospec's terms, so this site only shows the palettes that ship with the editor.

Other palettes here: PICO-8 palette, Game Boy palette, and the palette index. To edit, import or keep colours exact, read the palettes guide.