QB64.com

QB64 is a modern extended BASIC programming language that retains QBasic/QuickBASIC 4.5 compatibility and compiles native binaries for Windows, Linux, and macOS.

The PALETTE statement can swap color settings, set colors to default or set the red, green and blue color components of palette colors.

Syntax

PALETTE [attribute%, red% + (green% * 256) + (blue% * 65536)]

PALETTE [existingAttribute%, newAttribute%]

Description

QBasic

Example(s)

Displaying all 64 DAC color hues as backgrounds in SCREEN 9 using a PALETTE swap.


  SCREEN 9 ' background is default black
  LOCATE 20, 33: PRINT "Press any Key!"  
  FOR i = 1 TO 64
   a$ = INPUT$(1) ' wait for a keypress
   PALETTE 0, i
  NEXT 

Note: Other attributes (1 to 15) can also be swapped for DAC foreground colors.

See Also