main.cpp 1.5 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253
  1. #include <iostream>
  2. using namespace std;
  3. inline void resetColor() {
  4. cout << "\033[0;30m" << "\033[0;49m" ;
  5. }
  6. int main() {
  7. cout << "Show colors" << endl;
  8. cout << endl << "Typical combinations" << endl;
  9. cout << "\033[0;30m" << "Black" << endl;
  10. cout << "\033[1;30m" << "Dark Gray" << endl;
  11. cout << "\033[0;34m" << "Blue" << endl;
  12. cout << "\033[1;34m" << "Light Blue" << endl;
  13. cout << "\033[0;32m" << "Green" << endl;
  14. cout << "\033[1;32m" << "Light Green" << endl;
  15. cout << "\033[0;36m" << "Cyan" << endl;
  16. cout << "\033[1;36m" << "Light Cyan" << endl;
  17. cout << "\033[0;31m" << "Red" << endl;
  18. cout << "\033[1;31m" << "Light Red" << endl;
  19. cout << "\033[0;35m" << "Purple" << endl;
  20. cout << "\033[1;35m" << "Light Purple" << endl;
  21. cout << "\033[0;33m" << "Brown" << endl;
  22. cout << "\033[1;33m" << "Yellow" << endl;
  23. cout << "\033[0;37m" << "Light Gray" << endl;
  24. cout << "\033[1;37m" << "White" << endl;
  25. resetColor();
  26. cout << endl << "Loop combinations" << endl;
  27. for (int cat(0) ; cat <= 1 ; cat ++) {
  28. for (int kind(3) ; kind <= 4 ; kind ++) {
  29. for (int color(0); color <= 9; color ++) {
  30. cout << cat << ';' << kind << color << endl;
  31. cout << "\033[" << cat << ';' << kind << color << 'm';
  32. cout << "Sample #|!0123456789AaBbCc";
  33. resetColor();
  34. cout << endl;
  35. }
  36. }
  37. }
  38. cout << endl << "Upperline" << endl;
  39. cout << endl << "Some text" << endl;
  40. cout << "\033[0;53m";
  41. cout << endl << "Some text" << endl;
  42. resetColor();
  43. cout << endl << "End." << endl;
  44. return 0;
  45. }