Skip to content

Instantly share code, notes, and snippets.

@Nathaniel100
Created July 11, 2016 08:29
Show Gist options
  • Save Nathaniel100/84da93a77b267bb6f8b800b79a6550f2 to your computer and use it in GitHub Desktop.
Save Nathaniel100/84da93a77b267bb6f8b800b79a6550f2 to your computer and use it in GitHub Desktop.
Color text in terminal applications in UNIX
#define RED "\x1B[31m"
#define GRN "\x1B[32m"
#define YEL "\x1B[33m"
#define BLU "\x1B[34m"
#define MAG "\x1B[35m"
#define CYN "\x1B[36m"
#define WHT "\x1B[37m"
#define RESET "\x1B[0m"
printf("This is " RED "red" RESET " and this is " BLU "blue" RESET "\n");
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment