mirror of
https://github.com/QB64Official/qb64.git
synced 2024-09-28 11:17:47 +00:00
72126a1289
* Create `$NOPREFIX`-friendly version of `color0.bi` * Create color32_noprefix.bi * add conditional for noprefix $color * oh. it was that easy? * Update CHANGELOG.md * Update help files [ci-skip] Co-authored-by: all-other-usernames-were-taken <74026992+all-other-usernames-were-taken@users.noreply.github.com>
50 lines
1.4 KiB
Text
50 lines
1.4 KiB
Text
[[$COLOR]] is a metacommand that adds named color [[CONST|constants]] in a program.
|
|
|
|
|
|
{{PageSyntax}}
|
|
: [[$COLOR]]:0
|
|
: [[$COLOR]]:32
|
|
|
|
|
|
{{PageDescription}}
|
|
* [[$COLOR]]:0 adds [[CONST|constants]] for colors 0-15. The actual constant names can be found in the file '''source/utilities/color0.bi'''.
|
|
* [[$COLOR]]:32 adds [[CONST|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.
|
|
* ''NOTE'': When using [[$NOPREFIX]], the color constants change to '''C_<old name>''' (ex: '''Blue''' becomes '''C_Blue''').
|
|
|
|
|
|
{{PageExamples}}
|
|
''Example 1:'' Adding named color constants for SCREEN 0:
|
|
{{CodeStart}}
|
|
{{Cl|$COLOR}}:0
|
|
{{Cl|COLOR}} BrightWhite, Red
|
|
{{Cl|PRINT}} "BrightWhite on red."
|
|
{{CodeEnd}}
|
|
|
|
|
|
''Example 2:'' Adding named color constants for 32-bit modes:
|
|
{{CodeStart}}
|
|
{{Cl|SCREEN}} {{Cl|_NEWIMAGE}}(640, 400, 32)
|
|
{{Cl|$COLOR}}:32
|
|
{{Cl|COLOR}} CrayolaGold, DarkCyan
|
|
{{Cl|PRINT}} "CrayolaGold on DarkCyan."
|
|
{{CodeEnd}}
|
|
|
|
|
|
''Example 3:'' Using [[$COLOR]] with [[$NOPREFIX]]:
|
|
{{CodeStart}}
|
|
{{Cl|$NOPREFIX}}
|
|
{{Cl|$COLOR}}:0
|
|
{{Cl|COLOR}} C_BrightWhite, C_Red
|
|
{{Cl|PRINT}} "BrightWhite on Red."
|
|
{{CodeEnd}}
|
|
|
|
|
|
{{PageSeeAlso}}
|
|
* [[COLOR]], [[SCREEN]]
|
|
* [[_NEWIMAGE]], [[$INCLUDE]]
|
|
* [[$NOPREFIX]]
|
|
* [[Metacommand]]
|
|
|
|
|
|
{{PageNavigation}}
|