mirror of
https://github.com/QB64Official/qb64.git
synced 2024-09-28 11:17:47 +00:00
48 lines
1.1 KiB
Text
48 lines
1.1 KiB
Text
{{DISPLAYTITLE:_BACKGROUNDCOLOR}}
|
|
The [[_BACKGROUNDCOLOR]] function returns the current background color.
|
|
|
|
|
|
{{PageSyntax}}
|
|
:{{Parameter|BGcolor&}} = [[_BACKGROUNDCOLOR]]
|
|
|
|
|
|
|
|
{{PageDescription}}
|
|
* Use it to get the current background color to restore later in a program.
|
|
* Returns the closest attribute value of the background color.
|
|
|
|
|
|
{{PageExamples}}
|
|
''Example 1:'' Storing a background color for later use.
|
|
{{CodeStart}} '' ''
|
|
{{Cl|SCREEN}} 0
|
|
{{Cl|COLOR}} 1, 3
|
|
{{Cl|CLS}}
|
|
BG% = {{Cl|_BACKGROUNDCOLOR}}
|
|
{{Cl|PRINT}} BG%
|
|
{{CodeEnd}}
|
|
{{BlueStart}}3
|
|
{{BlueEnd}}
|
|
|
|
|
|
''Example 2:'' Understanding the function output
|
|
{{CodeStart}} '' ''
|
|
{{Cl|SCREEN}} 0
|
|
{{Cl|COLOR}} 1, 11
|
|
{{Cl|CLS}}
|
|
BG% = {{Cl|_BACKGROUNDCOLOR}}
|
|
{{Cl|PRINT}} BG% 'prints the attribute as 3 instead of 11
|
|
{{CodeEnd}}
|
|
{{BlueStart}}3
|
|
{{BlueEnd}}
|
|
:''Explanation: SCREEN 0 background colors over 7 will return the lower intensity color attribute values: EX: attribute - 8
|
|
|
|
|
|
{{PageSeeAlso}}
|
|
* [[_DEFAULTCOLOR]]
|
|
* [[COLOR]], [[SCREEN]]
|
|
* [[SCREEN (function)]]
|
|
* [[Windows_Libraries#Color_Dialog_Box|Color Dialog Box]]
|
|
|
|
|
|
{{PageNavigation}}
|