The ZX Spectrum Color Palette, Resolution and Attributes


Colour palette

The ZX Spectrum computer uses a variation of the 4-bit RGBI palette philosophy. This results in each of the colours of the 3-bit palette having a basic and bright variant, with the exception of black. The bright half of the palette is generated using the video display’s maximum voltage levels for each of the three R/G/B colour components that a colour uses. The basic half of the palette is displayed by simply reducing these voltages.

In the ZX Spectrum encoding the colour components are in GRB order (from most to least significant bit) rather than the more common RGB order. The GRB order has the advantage that the colour numbers become ordered by increasing luminance, so if viewed on black-and-white display the ordered sequence 0 to 7 would form a gradient from black to white. Specifically, blue has a binary weight of 1, red has a weight of 2, and green has a weight of 4. As with any binary number, these weights add up to produce a single decimal number that matches the displayed colour, the effect of which can be seen in the table below (pay special attention to the “binary value” column).

INNO3D GeForce RTX 3090 Review
INNO3D GeForce RTX 3090 Review

For any value of n from 0 to 7, the following commands can be used to set or alter the screen’s colours:

  • BORDER n, the colour for surrounding area outside the main bitmap.
  • PAPER n, the background (pixel bit value of 0) colour for the colour cell to be altered.
  • INK n, the foreground (pixel bit value of 1) colour for the colour cell to be altered.

Furthermore, the BRIGHT command can be used to change the setting of the PAPER and INK commands’ “bright” flag (the I in RGBI), giving them access to the entire 15-colour palette. Settings of “0” and “1” turn bright mode off and on (respectively). Since only one bit within a colour attribute byte is used to select the brightness for both foreground and background colours in a colour cell, it is not possible to select both bright and basic colour modes in the same colour cell. The BORDER command does not use a bright flag, thus only the eight basic colours are supported.

Counting from least to most significant bit, an attribute byte dedicates three bits for the foreground colour, three bits for the background colour, one bit for the bright flag, and one bit for the flashing effect (which causes the video display to alternate foreground and background colours periodically).Standard ZX Spectrum palette with dithering, in pixel art

colour numberBinary valueBRIGHT 0 (RGB)BRIGHT 1 (RGB)colour nameEGA/VGA 16col. equivalent BRIGHT 0EGA/VGA 16col. equivalent BRIGHT 1
0000#000000#000000black00
1001#0000D7#0000FFblue412
2010#D70000#FF0000red19
3011#D700D7#FF00FFmagenta513
4100#00D700#00FF00green210
5101#00D7D7#00FFFFcyan614
6110#D7D700#FFFF00yellow311
7111#D7D7D7#FFFFFFwhite815

ZX Spectrum Screen Resolution

Standard ZX Spectrum screen

The original ZX Spectrum has a screen resolution of 256×192 pixels. Colour information is overlaid onto this as a grid of 8×8 pixel regions known as attribute blocks; within each attribute block, only two colours may be used out of a palette of 8 (black, blue, red, magenta, green, cyan, yellow and white). Additionally, the entire attribute block may be designated as ‘bright’, resulting in a total of 15 possible colours (because both bright and dark black is the same colour #000000). In many programs this limitation was evident as attribute clash.

Details:

Pixels: 256 × 192

Attributes: 32 × 24

Colors: 15

Actual resolution over composite video connections

TV blur 128×192 ZX Spectrum screen

Due to the limitations of the original Composite video connection to an analogue PAL TV, adjacent pixels were in fact blurred out horizontally. The resulting resolution depended on the quality of the TV set and on the colour combinations used by each particular image, but on most cases was similar to ~128×192.

This effect was used to increase the number of displayed colours on screen by almost all of the graphic designers, using dithering techniques. Close to a total of 64 colours become possible this way. Some emulators provide some sort of “blur” image processing trying to simulate this effect.

Details:

Pixels: ~128 × 192

Attributes: 32 × 24

Colors: ~128 (considering dither and bright/non bright colour variations)

Monochrome TVs and monitors

ZX Spectrum palette on a monochrome display

By using a monochrome monitor or black and white TV (or reducing the colour settings of a colour TV), it is possible to take advantage of the differences in intensity over the Spectrum’s colour range to generate a 15-shade grayscale image at 256×192 resolution.

Details:

Pixels: 256 × 192

Attributes: 32 × 24

Colors: 15 grayscale

Recent Posts