123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354 |
- #include <iostream>
- using namespace std;
- inline void resetColor() {
- cout << "\033[0;30m" << "\033[0;49m" ;
- }
- int main() {
- cout << "Show colors" << endl;
- cout << endl << "Typical combinations" << endl;
- cout << "\033[0;30m" << "Black" << endl;
- cout << "\033[1;30m" << "Dark Gray" << endl;
- cout << "\033[0;34m" << "Blue" << endl;
- cout << "\033[1;34m" << "Light Blue" << endl;
- cout << "\033[0;32m" << "Green" << endl;
- cout << "\033[1;32m" << "Light Green" << endl;
- cout << "\033[0;36m" << "Cyan" << endl;
- cout << "\033[1;36m" << "Light Cyan" << endl;
- cout << "\033[0;31m" << "Red" << endl;
- cout << "\033[1;31m" << "Light Red" << endl;
- cout << "\033[0;35m" << "Purple" << endl;
- cout << "\033[1;35m" << "Light Purple" << endl;
- cout << "\033[0;33m" << "Brown" << endl;
- cout << "\033[1;33m" << "Yellow" << endl;
- cout << "\033[0;37m" << "Light Gray" << endl;
- cout << "\033[1;37m" << "White" << endl;
- resetColor();
- cout << endl << "Loop combinations" << endl;
- for (int cat(0) ; cat <= 8 ; cat ++) {
- for (int color(0); color <= 7; color ++) {
- for (int kind(3) ; kind <= 4 ; kind ++) {
- cout << "\033[" << cat << ';' << kind << color << 'm';
- cout << cat << ';' << kind << color;
- resetColor();
- cout << ' ';
- }
- cout << " | ";
- }
- cout << endl;
- }
- cout << endl << "Upperline" << endl;
- cout << endl << "Some text" << endl;
- cout << "\033[0;53m";
- cout << endl << "Some text" << endl;
- resetColor();
- cout << endl << "End." << endl;
- return 0;
- }
|