Bypass navigation menu
RGB Classic Games
Keeping the classics alive
Currently hosting 566 great games!
Return to Chapter 2

SetPalette(Palette, Color)

Allows you to redefine any one of the 16 palette registers.

Palettes registers are special areas in the video system that determine what colors are displayed on the screen. There are 16 in all allowing for the 16 different colors. By default each palette register has the same value as its corresponding color number. For example, palette register 1 has a value of 1, which is blue, and palette register 5 has a value of 5, which is magenta. This means that all 16 palette registers initially have the values 0-15.

Parameters

Palette - Palette register number to set
Color - New color value for palette register

Examples

BASIC

CALL SetPalette(1, 10)

PASCAL

SetPalette(1, 10);

BGI equivalent

void setpalette(int colornum, int color);