Skip to content
Game 0 Unit 10 of 15 1 hr learning time

Colour, and Text in Many Colours

Turn a grey screen into a Spectrum screen. INK, PAPER and BORDER set the colours; BRIGHT and FLASH add punch; and a loop that changes INK per letter paints text in every colour at once. The title card gets its palette.

67% of Meet BASIC

This is where the Spectrum stops looking like a terminal. The machine has eight colours, numbered 0 to 7 — black, blue, red, magenta, green, cyan, yellow, white — and a handful of keywords to paint with them.

Milestone 1 — INK, PAPER, and BORDER

INK is the colour text is drawn in, PAPER the colour behind it, BORDER the frame around the screen. Set them, CLS to fill the screen with the new PAPER, then print:

  10 BORDER 1
  20 PAPER 1
  30 INK 6
  40 CLS
  50 PRINT AT 8, 11; "MEET BASIC"
  60 PRINT AT 10, 7; "a Spectrum primer"

BORDER 1 and PAPER 1 make the frame and background blue; INK 6 draws the text in yellow. The title card has a palette now.

The Spectrum screen showing MEET BASIC and a Spectrum primer in yellow on a fully blue screen with a blue border.
Yellow on blue, border and all — the classic Spectrum look. Set INK, PAPER and BORDER before CLS so the whole screen takes the colours.

Milestone 2 — BRIGHT and FLASH

Two more keywords add punch. BRIGHT 1 makes a colour more vivid; FLASH 1 makes a cell swap its ink and paper several times a second, to catch the eye:

Step 2: a bright word and a flashing one
+3
44 40 CLS
55 50 PRINT AT 8, 11; "MEET BASIC"
66 60 PRINT AT 10, 7; "a Spectrum primer"
7+ 70 PRINT AT 14, 7; "normal";
8+ 80 PRINT AT 14, 18; BRIGHT 1; "bright"
9+ 90 PRINT AT 16, 11; FLASH 1; "FLASH"
710

You can put these inside a PRINT, before the text they affect, so they apply to just that item. BRIGHT 1 lifts "bright" above the plain "normal" beside it; FLASH 1 sets "FLASH" swapping.

The Spectrum screen showing the title card, the words normal and bright, and FLASH shown as blue letters on a yellow block.
'bright' is a more vivid yellow than 'normal'. FLASH swaps ink and paper several times a second — the still caught it mid-swap, blue on yellow.

Milestone 3 — text in many colours

Because colour is set by a keyword, you can change INK between letters. A loop that bumps the INK each time, printing one character per pass, gives multicolour text — a rainbow:

  10 BORDER 0
  20 PAPER 0
  30 INK 7
  40 CLS
  50 LET t$ = "RAINBOW"
  60 FOR i = 1 TO 7
  70 INK i
  80 PRINT AT 10, 12 + i; t$(i)
  90 NEXT i

t$(i) is the i-th character of the string t$. Each pass sets INK i and prints one letter, so the seven letters of RAINBOW come out in colours 1 to 7.

The Spectrum screen showing the word RAINBOW with each letter in a different colour, on black.
One letter per pass, INK set to the loop counter — multicolour text. The same trick rainbows a title, a score, or a banner.

This is the Spectrum's "multicolour" in the honest sense: colour is stored per 8-by-8 cell, so each character cell can be a different colour — but two colours can't share one cell. That limit is the famous attribute clash; the games learn to work around it, and the smoothest tricks belong to the assembly track.

When it doesn't work

  • Integer out of range. A colour outside 0–7. INK 8 doesn't exist; the eight colours are 0 to 7.
  • The screen didn't change colour. You set PAPER but didn't CLS afterwards. CLS fills the screen with the current PAPER.
  • Everything went one colour. A statement like INK 2 on its own sets the colour for everything after it. Put the colour inside a PRINT to limit it to one item.

Before and after

You started with grey text on grey and finished painting the screen — a coloured title card, a bright accent, a flashing word, and a rainbow built one letter at a time. The idea underneath: INK, PAPER, BORDER, BRIGHT and FLASH colour the screen, per 8-by-8 cell — and changing INK between letters makes multicolour text.

Try this

  • Your own scheme. Pick an INK and PAPER you like and recolour the title card.
  • Rainbow the title. Loop over MEET BASIC, cycling INK 1 to 7, for a rainbow banner. (Keep the colour in range — wrap back to 1 after 7.)
  • A flashing prompt. Add a FLASH 1 line that says "press a key".

What you've learnt

  • Eight colours, 0 to 7: INK (text), PAPER (background), BORDER (frame).
  • BRIGHT 1 makes a colour vivid; FLASH 1 swaps ink and paper to catch the eye.
  • A colour keyword inside a PRINT affects just that item; on its own it sets everything after.
  • Changing INK per letter gives multicolour text; colour is per 8-by-8 cell.

What's next

The title card has a place and a palette. Now give it a voice. In Unit 11 the Spectrum sings: BEEP plays a note, and a loop turns notes into a fanfare.