_getbkcolor

Description

Gets the current background color.

#include <graph.h>

long __far _getbkcolor( void );

Remarks

The _getbkcolor function returns the current background color. The default is 0.

In a color text mode such as _TEXTC80, _setbkcolor accepts, and _getbkcolor returns, a color index. For example, _setbkcolor(2L) sets the background color to color index 2. The actual color displayed depends on the palette mapping for color index 2. The default for color index 2 is green in a color text mode.

In a color graphics mode such as _ERESCOLOR, _setbkcolor accepts, and _getbkcolor returns, a color value (as used in _remappalette). The value for the simplest background colors is given by the manifest constants defined in the GRAPH.H include file. For example, _setbkcolor(_GREEN) sets the background color in a graphics mode to green. These manifest constants are provided as a convenience in defining and manipulating the most common colors. In general, the actual range of colors is much greater.

In most cases, whenever a color argument is long, it refers to a color value, and whenever it is short, it refers to a color index. The two exceptions are _setbkcolor and _getbkcolor, described above. For a more complete discussion of colors, see _remappalette.

Return Value

The function returns the current background color. There is no error return.

Compatibility

Standards:None

16-Bit:DOS

32-Bit:None

See Also

_remappalette, _setbkcolor

Example

See the example for _getcolor.