main.cpp 1.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354
  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 <= 8 ; cat ++) {
  28. for (int color(0); color <= 7; color ++) {
  29. for (int kind(3) ; kind <= 4 ; kind ++) {
  30. cout << "\033[" << cat << ';' << kind << color << 'm';
  31. cout << cat << ';' << kind << color;
  32. resetColor();
  33. cout << ' ';
  34. }
  35. cout << " | ";
  36. }
  37. cout << endl;
  38. }
  39. cout << endl << "Upperline" << endl;
  40. cout << endl << "Some text" << endl;
  41. cout << "\033[0;53m";
  42. cout << endl << "Some text" << endl;
  43. resetColor();
  44. cout << endl << "End." << endl;
  45. return 0;
  46. }