xtd.console - Reference Guide  0.0.1
Modern c++17 library to manage terminal on Windows, macOS and Linux.

§ background_color() [1/2]

template<class Char >
static console_color xtd::basic_console< Char >::background_color ( )
inlinestaticnoexcept

Gets the background color of the console.

Returns
the background console_color.
Remarks
A get operation for a Windows-based application, in which a console does not exist, returns console_color.Black.
Example
The following example saves the values of the console_color enumeration to an array and stores the current values of the background_color and foreground_color properties to variables. It then changes the foreground color to each color in the console_color enumeration except to the color that matches the current background, and it changes the background color to each color in the console_color enumeration except to the color that matches the current foreground. (If the foreground color is the same as the background color, the text isn't visible.) Finally, it calls the reset_color method to restore the original console colors.