$COLOR

From QB64 Phoenix Edition Wiki
Revision as of 04:21, 19 April 2022 by SMcNeill (talk | contribs) (Created page with "$COLOR is a metacommand that adds named color constants in a program. {{PageSyntax}} : $COLOR:0 : $COLOR:32 {{PageDescription}} * $COLOR:0 adds constants for colors 0-15. The actual constant names can be found in the file '''source/utilities/color0.bi'''. * $COLOR:32 adds constants for 32-bit colors, similar to HTML color names. The actual constant names can be found in the file '''source/utilities/color32.bi'''. * ...")
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to navigation Jump to search

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


Syntax

$COLOR:0
$COLOR:32


Description

  • $COLOR:0 adds constants for colors 0-15. The actual constant names can be found in the file source/utilities/color0.bi.
  • $COLOR:32 adds constants 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.
  • Not compatible with $NOPREFIX.


Examples

Example 1: Adding named color constants for SCREEN 0:

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


Example 2: Adding named color constants for 32-bit modes:

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


See also



Navigation:
Main Page with Articles and Tutorials
Keyword Reference - Alphabetical
Keyword Reference - By usage
Report a broken link