1
1
Fork 0
mirror of https://github.com/DualBrain/QB64.git synced 2023-11-19 13:10:13 +00:00
QB64-website/wiki/$COLOR.md
2022-12-24 21:14:48 -06:00

1.3 KiB

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

Syntax

$COLOR:{0|32}

Description

  • $COLOR:0 adds CONST for colors 0-15. The actual constant names can be found in the file source/utilities/color0.bi.
  • $COLOR:32 adds CONST for 32-bit colors, similar to HTML color names. The actual constant names can be found in the file source/utilities/color32.bi.
  • $COLOR is a shorthand to manually using $INCLUDE pointing to the files listed above.
  • NOTE: When using $NOPREFIX, the color constants change to C_ (ex: Blue becomes C_Blue).

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