Egghead.page Logo

How Did the Sinclair ZX Spectrum Generate Colors?

The Sinclair ZX Spectrum, an iconic 8-bit home computer, utilized a unique and constrained method for generating color that defined its visual identity. This article explores the technical mechanisms behind its 15-color palette, explaining how the ULA chip managed color attributes within specific screen blocks. Readers will gain insight into the famous “color clash” phenomenon and understand the hardware compromises that shaped gaming graphics during the 1980s.

At the heart of the Spectrum’s video output was the Uncommitted Logic Array (ULA), a custom chip designed to keep manufacturing costs low. While the machine boasted a resolution of 256 by 192 pixels, it did not assign color information to every individual pixel. Instead, the screen was divided into a grid of 32 by 24 character blocks, with each block measuring 8 by 8 pixels. Within each of these blocks, only two colors could be displayed simultaneously: one for the ink (foreground) and one for the paper (background).

Color data was stored in a separate area of memory known as the attribute file. Each byte in this file corresponded to one of the 8 by 8 pixel blocks on the screen. This single byte contained all the color information for that specific block, utilizing a specific bit structure. Three bits defined the ink color, three bits defined the paper color, and the remaining two bits controlled brightness and flashing effects. This efficient use of memory allowed the Spectrum to maintain a full-color display while using only 16KB of video RAM.

The palette itself consisted of eight base colors: black, blue, red, magenta, green, cyan, yellow, and white. By utilizing the brightness bit, each of these colors could be displayed in a normal or bright variant, theoretically offering 16 combinations. However, since bright black is still visually black, the system effectively provided 15 distinct colors. This limitation meant that while the monochrome resolution was sharp, the color resolution was significantly lower, leading to the characteristic visual style of the era.

This architecture resulted in a well-known graphical artifact called attribute clash or color clash. Because only two colors could exist within any given 8 by 8 block, detailed sprites moving across multi-colored backgrounds often appeared to bleed into the surrounding colors. Developers had to carefully design graphics to align with the attribute grid or use monochrome techniques to avoid visual distraction. Despite these limitations, the ingenious management of the color palette allowed the Sinclair ZX Spectrum to become one of the most successful home computers in history.