
Click above to get retro games delivered to your door ever month!
X-Hacker.org- Watcom C/C++ v10.0 : C library - <b>synopsis:</b>
[<<Previous Entry] [^^Up^^] [Next Entry>>] [Menu] [About The Guide]
Synopsis:
#include <graph.h>
short _FAR _settextcolor( short pixval );
Description:
The _settextcolor function sets the current text color to be the color
indicated by the pixel value of the pixval argument. This is the color
value used for displaying text with the _outtext and _outmem
functions. Use the _setcolor function to change the color of graphics
output. The default text color value is set to 7 whenever a new video
mode is selected.
The pixel value pixval is a number in the range 0-31. Colors in the
range 0-15 are displayed normally. In text modes, blinking colors are
specified by adding 16 to the normal color values. The following table
specifies the default colors in color text modes.
Pixel Color Pixel Color
value value
0 Black 8 Gray
1 Blue 9 Light Blue
2 Green 10 Light Green
3 Cyan 11 Light Cyan
4 Red 12 Light Red
5 Magenta 13 Light Magenta
6 Brown 14 Yellow
7 White 15 Bright White
Returns:
The _settextcolor function returns the pixel value of the previous text
color.
See Also:
_gettextcolor, _outtext, _outmem, _setcolor
Example:
#include <conio.h>
#include <graph.h>
main()
{
int old_col;
long old_bk;
_setvideomode( _TEXTC80 );
old_col = _gettextcolor();
old_bk = _getbkcolor();
_settextcolor( 7 );
_setbkcolor( _BLUE );
_outtext( " WATCOM \nGraphics" );
_settextcolor( old_col );
_setbkcolor( old_bk );
getch();
_setvideomode( _DEFAULTMODE );
}
Classification:
PC Graphics
Systems:
DOS, QNX
Online resources provided by: http://www.X-Hacker.org --- NG 2 HTML conversion by Dave Pearson