Function mrpt::system::consoleColorAndStyle

Function Documentation

void mrpt::system::consoleColorAndStyle(ConsoleForegroundColor fg, ConsoleBackgroundColor bg = ConsoleBackgroundColor::DEFAULT, ConsoleTextStyle style = ConsoleTextStyle::REGULAR, bool applyToStdErr = false)

Changes the text color and style in the console for the text written from now on. See available colors in ConsoleForegroundColor and ConsoleBackgroundColor.

By default the color of “cout” is changed, unless changeStdErr=true, in which case “cerr” is changed.

Note

GNU/Linux: If stdout/stderr is not a real terminal with color support, calling this function will have no effect (i.e. no escape characters will be emitted).

Note

The current implementation only supports a subset of all colors for Windows terminals.

Note

(New in MRPT 2.3.3)