-
Notifications
You must be signed in to change notification settings - Fork 0
textbackground
Function Selects new text background color
Syntax void textbackground(int newcolor);
Prototype in conio.h
Return value None.
See also gettextinfo, textattr, textcolor
textbackground selects the background text color. The background color of all characters subsequently written by functions performing text mode, direct video output will be in the color given by newcolor, an integer from 0 to 7. You can give the color using one of the symbolic constants defined in conio.h. If you use these constants, you must include conio.h.
This function does not affect any characters currently on the screen, but only those displayed using direct console output (such as cprintf) after textbackground has been called.
The following table lists the allowable colors (as symbolic constants) and their numeric values:
| Symbolic Constant | Numeric Value |
|---|---|
| BLACK | 0 |
| BLUE | 1 |
| GREEN | 2 |
| CYAN | 3 |
| RED | 4 |
| MAGENTA | 5 |
| BROWN | 6 |
| LIGHTGRAY | 7 |
// makes a magenta background
textbackground(MAGENTA);