< index
< 2. Console emulator
< 2.2 Drawing on the root console

=====================================
Setting the default foreground color
=====================================

C++ : void TCODConsole::setForegroundColor(TCODColor back)
C   : void TCOD_console_set_foreground_color(TCOD_console_t con,TCOD_color_t back)
Py  : console_set_foreground_color(con,back)

This function changes the default foreground color for a console. The default foreground color is used by several drawing functions like clear, putChar, ...
To change the default foreground color of the root console, use

C++ : TCODConsole::root->setForegroundColor(myColor)
C   : TCOD_console_set_foreground_color(NULL, my_color)
Py  : libtcod.console_set_foreground_color(0, my_color)

ParameterDescription
conIn the C version, the offscreen console handler or NULL for the root console.
backThe new default foreground color for this console.
insert a comment