Shows how to use xtd::console::background_color and xtd::console::foreground_color methods.
#include <xtd/console>
auto main()->int {
auto colors = {
console_color::black,
console_color::dark_blue,
console_color::dark_green,
console_color::dark_cyan,
console_color::dark_red,
console_color::dark_magenta,
console_color::dark_yellow,
console_color::gray,
console_color::dark_gray,
console_color::blue,
console_color::green,
console_color::cyan,
console_color::red,
console_color::magenta,
console_color::yellow,
console_color::white};
console::write_line(
"All the foreground colors except {}, the background color:", current_background);
for (auto color : colors) {
if (color == current_background) continue;
}
console::write_line(
"All the background colors except {}, the foreground color:", current_foreground);
for (auto color : colors) {
if (color == current_foreground) continue;
}
}