_BACKGROUNDCOLOR - QB64 Wiki

_BACKGROUNDCOLOR

From QB64 Wiki

Jump to: navigation, search

The _BACKGROUNDCOLOR function returns the current background color.


Syntax:

BGcolor& = _BACKGROUNDCOLOR


Description:

  • Use it to get the current background color to restore later in a program.
  • Will return the closest attribute value of the background color


Example: Storing a background color for later use.

SCREEN 0 COLOR 1, 11 CLS BG% = _BACKGROUNDCOLOR PRINT BG% 'prints the attribute as 3 instead of 11

3

Explanation: SCREEN 0 background colors over 7 will return the lower intensity color attribute values: EX: attribute - 8


See also:



Navigation:
Go to Keyword Reference - Alphabetical
Go to Keyword Reference - By usage
Go to Main WIKI Page
Views
  • Page
  • Discussion
  • View source
  • History
Personal tools
  • Log in
Toolbox
  • What links here
  • Related changes
  • Special pages
  • Printable version