Important Notice
The pages on this site contain documentation for very old MS-DOS software,
purely for historical purposes.
If you're looking for up-to-date documentation, particularly for programming,
you should not rely on the information found here, as it will be woefully
out of date.
setbkcolor
◄Summary► ◄Example► ◄Up► ◄Contents► ◄Index► ◄Back►
────────────────────────────────────────────────────────────────────────────
The setbkcolor function sets the current background color to the
color value <color>.
In a color text mode (such as $TEXTC80), setbkcolor accepts a color
index. The values for the default colors are shown in a table in
the description of the settextcolor function.
For example, "setbkcolor(2)" sets the background color to color
index 2. The actual color displayed depends on the palette mapping
for color index 2. The default is green in color text mode.
In color graphics mode (such as $ERESCOLOR), setbkcolor accepts a
color value. The values for the simplest background colors are
given by the symbolic constants defined in FGRAPH.FD (for instance,
$GREEN). These symbolic constants are provided as a convenience in
defining and manipulating the most common colors. The actual range
of colors is, in general, much greater.
See ◄Graphic Mode Colors►
In general, when an argument is INTEGER*4, it refers to a color
value, and when it is INTEGER*2, it refers to a color index. The
two exceptions are setbkcolor and getbkcolor, where it can be
either, depending on the mode.
Using an argument of 0 for the remappalette function will do what
setbkcolor does. Unlike remappalette, however, setbkcolor does not
require an EGA or VGA environment.
In text mode, the setbkcolor function does not affect anything
already appearing on the display (only the subsequent output). In
graphics mode, it immediately changes all background pixels.
Return Value
Returns the previous background color.
-♦-