COLOR

From C64-Wiki
Jump to navigationJump to search
BASIC keyword
Keyword: COLOR
Abbreviation: CO Shift+L
Type: Command
Token code: UNK
Handling routine
in BASIC ROM:
UNK
List of all BASIC keywords


Remark: This article describes the BASIC command COLOR in Commodore BASIC V3.5.

Type: Command
General Programming-Syntax: 
  COLOR <color source#>, <color #> ,[<luminance #>

COLOR is a BASIC 3.5 command that is used to change the color of the display.

Number Source
0 background
1 foreground
2 multicolor 1
3 multicolor 2
4 border

Colors you can use are in the range 1-16 (Black, White...). As an option, you can include the luminance level 0-7, with 0 being lowest and 7 being highest. Luminance defaults to 7. Luminance lets you select from 8 levels of brightness for any color except black.

This results in a palette of 121 different color tones, given the fact that black always remains the same in all eight brightness levels.

The following colors can be assigned using the Color value parameter:

Color
(Stufe 7)
Color
(Stufe 4)
Color
(Stufe 0)
Name Value
Black
Black
Black
Black 1
White Light
White Middel
White Darker
White 2
Red Light
Red Middel
Red Darker
Red 3
Cyan Light
Cyan Middel
Cyan Darker
Cyan 4
Purple Light
Purple Middel
Purple Darker
Purple 5
Green Light
Green Middel
Green Darker
Green 6
Blue Light
Blue Middel
Blue Darker
Blue 7
Yellow Light
Yellow Middel
Yellow Darker
Yellow 8
Orange Light
Orange Middel
Orange Darker
Orange 9
Brown Light
Brown Middel
Brown Darker
Brown 10
Yellow Green Light
Yellow Green Middel
Yellow Green Darker
YellowGreen 11
Rosa Light
Rosa Middel
Rosa Darker
Rosa 12
BlueGreen Light
BlueGreen Middel
BlueGreen Darker
BlueGreen 13
Light Blue Light
Light Blue Middel
Light Blue Darker
Light Blue 14
Zyklam Light
Zyklam Middel
Zyklam Darker
Zyklam 15
Light Green Light
Light Green Middel
Light Green Darker
Light Green 16

Parameter values outside the ranges described above are acknowledged with the error message ?ILLEGAL QUANTITY ERROR. If not two or three parameters are present, the error message ?SYNTAX ERROR will appear.

Examples[edit | edit source]

Sets the border to black:

COLOR 4,1

Sets the background to white:

COLOR 0,2

Sets the foreground to blue-green, with half intensity:

COLOR 1,13,4


BASIC V3.5 Commands

ABS | ASC | ATN | AUTO | BACKUP | BOX | CHAR | CHR$ | CIRCLE | CLOSE | CLR | CMD | COLLECT | COLOR | CONT | COPY | COS | DATA | DEC | DEF | DELETE | DIM | DIRECTORY | DLOAD | DO | DRAW | DS | DS$ | DSAVE | END | EL | ELSE | ER | ERR$ | EXIT | EXP | FN | FOR | FRE | GET | GET# | GETKEY | GOSUB | GOTO | GRAPHIC | GSHAPE | HEADER | HELP | HEX$ | IF | INPUT | INPUT# | INSTR | INT | JOY | KEY | LEFT$ | LEN | LET | LIST | LOAD | LOCATE | LOG | LOOP | MID$ | MONITOR | NEW | NEXT | ON | OPEN | PAINT | PEEK | POKE | POS | PRINT | PRINT USING | PRINT# | PUDEF | RCLR | RDOT | READ | REM | RENAME | RENUMBER | RESTORE | RESUME | RETURN | RGR | RIGHT$ | RLUM | RND | RUN | SAVE | SCALE | SCNCLR | SCRATCH | SGN | SIN | SOUND | SPC | SQR | SSHAPE | STOP | STR$ | SYS | TAB | TAN | TRAP | TROFF | TRON | UNTIL | USR | VAL | VERIFY | VOL | WHILE | WAIT