Header File
conio.h
Category
Console I/O Routines
Prototype
void textcolor(int newcolor);
Description
Selects new character color in text mode.
Once you have called textcolor, all subsequent functions using direct video output (such as cprintf) will use newcolor. textcolor does not affect any characters currently onscreen.
The following table lists the allowable colors (as symbolic constants) and their numeric values:
BLACK |
0 |
BLUE |
1 |
GREEN |
2 |
CYAN |
3 |
RED |
4 |
MAGENTA |
5 |
BROWN |
6 |
LIGHTGRAY |
7 |
DARKGRAY |
8 |
LIGHTBLUE |
9 |
LIGHTGREEN |
10 |
LIGHTCYAN |
11 |
LIGHTRED |
12 |
LIGHTMAGENTA |
13 |
YELLOW |
14 |
WHITE |
15 |
BLINK |
128 |
You can make the characters blink by adding 128 to the foreground color. The predefined constant BLINK exists for this purpose.
For example:
textcolor(CYAN + BLINK);
None.
Portability
POSIX |
Win32 |
ANSI C |
ANSI C++ |
|
+ |
|
|
Copyright(C) 2009 Embarcadero Technologies, Inc. All Rights Reserved.
|
What do you think about this topic? Send feedback!
|