debug_tty_color.h 2.0 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950
  1. #ifndef _DEBUG_TTY_COLOR_H_
  2. #define _DEBUG_TTY_COLOR_H_
  3. //// Foreground Colours ////
  4. #define CLR_FG_BLACK "\033[0;30m"
  5. #define CLR_FG_BLUE "\033[0;34m"
  6. #define CLR_FG_GREEN "\033[0;32m"
  7. #define CLR_FG_CYAN "\033[0;36m"
  8. #define CLR_FG_RED "\033[0;31m"
  9. #define CLR_FG_PURPLE "\033[0;35m"
  10. #define CLR_FG_YELLOW "\033[0;33m"
  11. #define CLR_FG_LIGHT_GREY "\033[0;37m"
  12. #define CLR_FG_DARK_GREY "\033[1;30m"
  13. #define CLR_FG_LIGHT_BLUE "\033[1;34m"
  14. #define CLR_FG_LIGHT_GREEN "\033[1;32m"
  15. #define CLR_FG_LIGHT_CYAN "\033[1;36m"
  16. #define CLR_FG_LIGHT_RED "\033[1;31m"
  17. #define CLR_FG_LIGHT_PURPLE "\033[1;35m"
  18. #define CLR_FG_LIGHT_YELLOW "\033[1;33m"
  19. #define CLR_FG_WHITE "\033[1;37m"
  20. //// Background Colours ////
  21. #define CLR_BG_BLACK "\033[0;40m"
  22. #define CLR_BG_BLUE "\033[0;44m"
  23. #define CLR_BG_GREEN "\033[0;42m"
  24. #define CLR_BG_CYAN "\033[0;46m"
  25. #define CLR_BG_RED "\033[0;41m"
  26. #define CLR_BG_PURPLE "\033[0;45m"
  27. #define CLR_BG_YELLOW "\033[0;43m"
  28. #define CLR_BG_LIGHT_GREY "\033[0;47m"
  29. #define CLR_BG_DARK_GREY "\033[1;40m"
  30. #define CLR_BG_LIGHT_BLUE "\033[1;44m"
  31. #define CLR_BG_LIGHT_GREEN "\033[1;42m"
  32. #define CLR_BG_LIGHT_CYAN "\033[1;46m"
  33. #define CLR_BG_LIGHT_RED "\033[1;41m"
  34. #define CLR_BG_LIGHT_PURPLE "\033[1;45m"
  35. #define CLR_BG_LIGHT_YELLOW "\033[1;43m"
  36. #define CLR_BG_WHITE "\033[1;47m"
  37. //// Others ////
  38. #define CLR_DEFAULT "\033[0m"
  39. #define CLR_UNDERLINE "\033[4m"
  40. #define CLR_BLINK "\033[5m"
  41. #define CLR_INVERSE "\033[7m"
  42. #define CLR_CONCEALED "\033[8m"
  43. #define TTY_CLR_RED(mstr, fmt, args...) fprintf(stderr, CLR_BG_LIGHT_RED mstr " %s:%d "CLR_DEFAULT fmt , __FUNCTION__, __LINE__, ## args)
  44. #define TTY_DBG(mstr, fmt, args...) fprintf(stderr, mstr " %s:%d " fmt, __FUNCTION__, __LINE__, ## args)
  45. #define TTY_DBG_TMP(mstr, fmt, args...) fprintf(stderr, CLR_BG_RED mstr " %s:%d " CLR_DEFAULT fmt, __FUNCTION__, __LINE__, ## args)
  46. #endif