RicardasSim

console color text linux

Sep 12th, 2020
1,306
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. //-std=c99 -Wall -Wextra -Wpedantic -Wshadow
  2.  
  3. #include <stdio.h>
  4. #include <stdlib.h>
  5.  
  6. #define COLOR_RESET "\x1B[0m"
  7. #define COLOR_RED "\x1B[31m"
  8. #define COLOR_GREEN "\x1B[32m"
  9. #define COLOR_YELLOW "\x1B[33m"
  10. #define COLOR_BLUE "\x1B[34m"
  11. #define COLOR_MAGENTA "\x1B[35m"
  12. #define COLOR_CYAN "\x1B[36m"
  13. #define COLOR_WHITE "\x1B[37m"
  14.  
  15. int main()
  16. {
  17.  
  18.     printf( COLOR_GREEN "Green " COLOR_RESET );
  19.  
  20.     printf ( COLOR_RED "Red " COLOR_YELLOW "Yellow " COLOR_BLUE "Blue " COLOR_RESET );
  21.    
  22.     printf ( COLOR_MAGENTA "Magenta " COLOR_CYAN "Cyan " COLOR_WHITE "White" COLOR_RESET );
  23.    
  24.     printf ("\nBye bye !");
  25.    
  26.     return 0;
  27. }
RAW Paste Data