CGA palette: 16 colours with hex codes

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.
| Colour | Swatch | Hex | RGB |
|---|---|---|---|
| 0, black | #000000 | 0, 0, 0 | |
| 1, blue | #0000aa | 0, 0, 170 | |
| 2, green | #00aa00 | 0, 170, 0 | |
| 3, cyan | #00aaaa | 0, 170, 170 | |
| 4, red | #aa0000 | 170, 0, 0 | |
| 5, magenta | #aa00aa | 170, 0, 170 | |
| 6, brown | #aa5500 | 170, 85, 0 | |
| 7, light grey | #aaaaaa | 170, 170, 170 | |
| 8, dark grey | #555555 | 85, 85, 85 | |
| 9, light blue | #5555ff | 85, 85, 255 | |
| 10, light green | #55ff55 | 85, 255, 85 | |
| 11, light cyan | #55ffff | 85, 255, 255 | |
| 12, light red | #ff5555 | 255, 85, 85 | |
| 13, light magenta | #ff55ff | 255, 85, 255 | |
| 14, yellow | #ffff55 | 255, 255, 85 | |
| 15, white | #ffffff | 255, 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
FFFFFFAbout 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.
- Cyan and magenta, #55ffff and #ff55ff, are the famous pair. Together with white they make the look of early PC games.
- Colour 6, #aa5500, is brown. The card sent dark yellow, and IBM's own 5153 monitor was built to turn it into brown. Other monitors and clones could show dark yellow instead.
- Dark grey, #555555, is black with the intensity bit switched on, which is why it is the darkest step above black.
- Each bright colour is its dark partner with 55 added to red, green and blue. The only odd one is yellow, whose dark partner is the brown.
Use it in the editor
The palette is built in, so you do not need to paste anything.
- Open the editor and open the palette menu: the three dots at the top of the palette panel.
- Choose Built-in palettes, then CGA.
- 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.
- Press the button at the bottom. The whole change is one step, so Undo takes it back.

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
- Every channel is either off or on, so the colours are bold and a little harsh. Embrace it: pure cyan and magenta are the look.
- For an authentic look, pick four colours and stay with them, as the graphics mode did. All sixteen were available in text mode.
- The greys are the only smooth ramp: black, dark grey, light grey, white. Use them for shading and keep the colours for the things that matter.
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.