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.

$COLOR is a metacommand that adds named color CONST in a program.

Syntax

$COLOR:{0 32}

Description

Example(s)

Adding named color constants for SCREEN 0:


$COLOR:0
COLOR BrightWhite, Red
PRINT "BrightWhite on red."


Bright white on red.

Adding named color constants for 32-bit modes:


SCREEN _NEWIMAGE(640, 400, 32)
$COLOR:32
COLOR CrayolaGold, DarkCyan
PRINT "CrayolaGold on DarkCyan."


Using $COLOR with $NOPREFIX:


$NOPREFIX
$COLOR:0
COLOR C_BrightWhite, C_Red
PRINT "BrightWhite on Red."
 

See Also