graphics.hlp (
Topic list)
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.
_settextcolor
◄Summary► ◄Example► ◄Up► ◄Contents► ◄Index► ◄Back►
────────────────────────────────────────────────────────────────────────────
The _settextcolor function sets the current text color to the
color index specified by <index>. The default text color is the
same as the maximum color index.
The _settextcolor routine sets the color for the _outtext and
_outmem functions only. It does not affect the color of the printf
function or the color of text output with the _outgtext font
routine. Use the _setcolor function to change the color of font
output.
In text color mode, you can specify a color index in the range
0-31. The colors in the range 0-15 are interpreted as normal.
Colors in the range 16-31 are the same as those in the range 0-15
but also have blinking text. The normal color range is defined
below:
Index Color
0 Black
1 Blue
2 Green
3 Cyan
4 Red
5 Magenta
6 Brown
7 White
8 Dark gray
9 Light blue
10 Light green
11 Light cyan
12 Light red
13 Light magenta
14 Yellow
15 Bright white
In every text mode, including monochrome, the _getvideoconfig
function returns the value 32 for the number of available colors.
The value 32 indicates the range of values (0-31) accepted by the
_settextcolor function. This includes sixteen normal colors (0-15)
and sixteen blinking colors (16-31).
Blinking is selected by adding 16 to the normal color value. Some
color values are redundant because monochrome text mode has fewer
unique display attributes. However, because blinking is selected
in the same manner, monochrome text mode has the same range (0-31)
as other text modes.
Return Value
The function returns the color index of the previous text color.
There is no error return.
-♦-