1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253 |
- #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 <= 1 ; cat ++) {
- for (int kind(3) ; kind <= 4 ; kind ++) {
- for (int color(0); color <= 9; color ++) {
- cout << cat << ';' << kind << color << endl;
- cout << "\033[" << cat << ';' << kind << color << 'm';
- cout << "Sample #|!0123456789AaBbCc";
- resetColor();
- 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;
- }
|