#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};
auto current_background = console::background_color();
auto current_foreground = console::foreground_color();
console::write_line("All the foreground colors except {}, the background color:", current_background);
for (auto color : colors) {
if (color == current_background) continue;
console::foreground_color(color);
console::write_line(" The foreground color is {}.", color);
}
console::write_line();
console::foreground_color(current_foreground);
console::write_line("All the background colors except {}, the foreground color:", current_foreground);
for (auto color : colors) {
if (color == current_foreground) continue;
console::background_color(color);
console::write_line(" The background color is {}.", color);
}
console::reset_color();
console::write_line("\nOriginal colors restored...");
}
The xtd namespace contains all fundamental classes to access Hardware, Os, System,...
Definition xtd_about_box.hpp:10