ZX SPECTRUM Introduction

7. Colours

One of the reasons for buying the ZX Spectrum in the first place was the ability to use colour on the TV screen. The screen is divided into two areas. The outer part is referred to as BORDER, the central area as PAPER. It is possible to change the colours of these two sections at will, both directly from the keyboard and in a program.

The ZX Spectrum has eight colours to play with, and these are given numbers between 0 and 7. Although the colours look in random order, they do in tact give decreasing shades of grey on a monochrome TV. Here is a list or them for reference; they are also written over the appropriate number keys:

0 black

1 blue

2 red

3 purple or magenta

4 green

5 pale blue or cyan

6 yellow

7 white

When the computer is first switched on the system works in black and white. So the normal value for BORDER and PAPER is 7 i.e. white. The colour of any character appearing on the screen is defined by the INK command. This is normally 0 i.e., black. Initially the three commands controlling the screen colours are set by the computer.

However you can change these values. For example key


If you remembered to press the ENTER key the border should now change from white to red. This includes the area at the bottom where commands and instructions are typed in. Try typing in other numbers and see how the colours change.

Now try changing the centre of the screen area by keying


The PAPER command is one of the extended mode commands as mentioned earlier. It is obtained by typing both CAPS SHIFT and SYMBOLS SHIFT at the same time. PAPER is then a shifted C. When the ENTER key is pressed twice the centre of the screen should change to pale blue. The first ENTER cancels the PAPER command already stored in the computer, but only when the second ENTER is pressed causing the computer to LIST any program and therefore rebuild the screen information) does the new PAPER colour get used if you are using a colour television and it hasn't changed colour, try adjusting the colour controls on the television, and maybe the tuning control.

The INK command is similar to the PAPER command and controls the colour of the characters appearing on the PAPER section of the screen. Obviously if the INK and PAPER colours are the same nothing will appear on the screen

The BORDER, PAPER and INK commands can be used in programs. Here Is a simple one to show the range of colours available:

10 FOR x=1 TO 7


30 PAPER 7-x: CLS

40 PAUSE 50

50 NEXT x

This program, when RUN, goes through the eight colours, contrasting the PAPER and BORDER colours. The CLS command after PAPER forces the computer to rebuild the screen image and use the new PAPER colour. The PAUSE command stops the program for 1 second so that we can see what’s happening (Try running the program with the PAUSE left out.) To show how the INK command works type in the following program after a NEW command.


20 PAPER 1

30 INK 4

40 PRINT "Green characters on blue background"

There are other commands associated with the colour capabilities of the ZX Spectrum and these are detailed in the BASIC programming manual.


[C] [1] [2] [3] [4] [5] [6] [7] [8] [9]
ZX Format home