How to set the text and background colour on a C64

- by

Commodore LogoTo set the background colour on your beloved old C64 (and C128 in 40 column mode) you have to POKE the colour value into two registers, one for the background and one for the border. The poor little guy only had 16 colour values, 0 for black, 1 for white, etc.

To change the background to black:

  • poke 53280,0 (for the border)
  • poke 53281,0 (for the background)

Likewise you can read the current background colour out using PEEK:

  • bo = peek (53280)
  • bg = peek (53281)

The text colour has to be set before any text is written. You can do this either by PRINTing the PETSCII character which will come up automatically once you type the first quote (and stop appearing when you type the second) – much like you can print cursor commands. It’s tacky, but it works.

Another (perhaps better) way is to print a colour value using PRINT CHR$(x), where x is the value of the colour you’d like to write in.

Yet another way would be to set the colour for each existing character on the screen, starting at 55296 via POKE (you’d have to do this 1024 times, once for every character).

Refer to this handy table for all C64 colour values – courtesy of the C64 Wiki:



If you enjoy my content, please consider supporting me on Ko-fi. In return you can browse this whole site without any pesky ads! More details here.

6 thoughts on “How to set the text and background colour on a C64”

  1. D’oh! Thank you so much for letting me know, 80sBaby! I’ve corrected the article 😉

  2. I use this to set the background & text the way I like it..

    POKE53280,0:POKE53281,0:POKE646,14

    It works nicely as a single line but you could do it in 3 if you wanted to..

    10 POKE 53280,0 – black frame
    20 POKE 53281,0 – black background
    30 POKE 646,14 – light blue text

Leave a Comment!

This site uses Akismet to reduce spam. Learn how your comment data is processed.