xtd - Reference Guide  0.1.1
Modern c++17/20 framework to create console, GUI and unit test applications on Windows, macOS, Linux, iOS and android.
console_color.h
Go to the documentation of this file.
1 #pragma once
5 #include "ustring.h"
6 
8 namespace xtd {
17  enum class console_color {
19  black,
21  dark_blue,
23  dark_green,
25  dark_cyan,
27  dark_red,
33  gray,
35  dark_gray,
37  blue,
39  green,
41  cyan,
43  red,
45  magenta,
47  yellow,
49  white
50  };
51 
53  inline std::ostream& operator<<(std::ostream& os, console_color value) {return os << to_string(value, {{console_color::black, "black"}, {console_color::dark_blue, "dark_blue"}, {console_color::dark_green, "dark_green"}, {console_color::dark_cyan, "dark_cyan"}, {console_color::dark_red, "dark_red"}, {console_color::dark_magenta, "dark_magenta"}, {console_color::dark_yellow, "dark_yellow"}, {console_color::gray, "gray"}, {console_color::dark_gray, "dark_gray"}, {console_color::blue, "blue"}, {console_color::green, "green"}, {console_color::cyan, "cyan"}, {console_color::red, "red"}, {console_color::magenta, "magenta"}, {console_color::yellow, "yellow"}, {console_color::white, "white"}});}
54  inline std::wostream& operator<<(std::wostream& os, console_color value) {return os << to_string(value, {{console_color::black, L"black"}, {console_color::dark_blue, L"dark_blue"}, {console_color::dark_green, L"dark_green"}, {console_color::dark_cyan, L"dark_cyan"}, {console_color::dark_red, L"dark_red"}, {console_color::dark_magenta, L"dark_magenta"}, {console_color::dark_yellow, L"dark_yellow"}, {console_color::gray, L"gray"}, {console_color::dark_gray, L"dark_gray"}, {console_color::blue, L"blue"}, {console_color::green, L"green"}, {console_color::cyan, L"cyan"}, {console_color::red, L"red"}, {console_color::magenta, L"magenta"}, {console_color::yellow, L"yellow"}, {console_color::white, L"white"}});}
56 }
console_color
Specifies constants that define foreground and background colors for the console.
Definition: console_color.h:17
std::string to_string(const value_t &value, const std::string &fmt, const std::locale &loc)
Convert a specified value into a string with specified format and locale.
Definition: to_string.h:37
The xtd namespace contains all fundamental classes to access Hardware, Os, System,...
Definition: system_report.h:17
@ black
The color black.
@ dark_blue
The color dark blue.
@ blue
The color blue.
@ dark_gray
The color dark gray.
@ magenta
The color magenta (purplish red).
@ dark_green
The color dark green.
@ cyan
The color cyan (blue-green).
@ dark_red
The color dark red.
@ green
The color green.
@ dark_magenta
The color dark magenta (dark purplish-red).
@ red
The color red.
@ dark_cyan
The color dark cyan (dark blue-green).
@ gray
The color gray.
@ yellow
The color yellow.
@ white
The color white.
@ dark_yellow
The color dark yellow (ochre).
Contains xtd::ustring class.