xtd 0.2.0
console_background_color3.cpp

Shows how to use xtd::console::background_color method.

#include <xtd/background_color>
#include <xtd/reset_color>
using namespace std;
using namespace xtd;
auto main()->int {
cout << background_color(console_color::dark_blue) << " " << reset_color() << endl;
cout << background_color(console_color::blue) << " " << reset_color() << endl;
cout << endl;
cout << background_color(console_color::dark_green) << " " << reset_color() << endl;
cout << background_color(console_color::green) << " " << reset_color() << endl;
cout << endl;
cout << background_color(console_color::dark_cyan) << " " << reset_color() << endl;
cout << background_color(console_color::cyan) << " " << reset_color() << endl;
cout << endl;
cout << background_color(console_color::dark_red) << " " << reset_color() << endl;
cout << background_color(console_color::red) << " " << reset_color() << endl;
cout << endl;
cout << background_color(console_color::dark_magenta) << " " << reset_color() << endl;
cout << background_color(console_color::magenta) << " " << reset_color() << endl;
cout << endl;
cout << background_color(console_color::dark_yellow) << " " << reset_color() << endl;
cout << background_color(console_color::yellow) << " " << reset_color() << endl;
cout << endl;
cout << background_color(console_color::dark_gray) << " " << reset_color() << endl;
cout << background_color(console_color::gray) << " " << reset_color() << endl;
cout << endl;
cout << background_color(console_color::black) << " " << reset_color() << endl;
cout << background_color(console_color::white) << " " << reset_color() << endl;
cout << endl;
}
// This code produces the following output with colors:
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//