color.h 2.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960
  1. #ifndef _COLOR_H
  2. #define _COLOR_H
  3. #include "misc.h"
  4. #define CFLGS_BOLD BIT0
  5. #define CFLGS_REV BIT1
  6. #define CFLGS_UNDERLINE BIT2
  7. #define CFLGS_FLASH BIT3
  8. #define C_BLACK 1
  9. #define C_BLUE 2
  10. #define C_GREEN 3
  11. #define C_CYAN 4
  12. #define C_RED 5
  13. #define C_PURPLE 6
  14. #define C_BROWN 7
  15. #define C_LIGHTGREY 8
  16. #define C_DARKGREY 9
  17. #define C_LIGHTBLUE 10
  18. #define C_LIGHTGREEN 11
  19. #define C_LIGHTCYAN 12
  20. #define C_LIGHTRED 13
  21. #define C_LIGHTPURPLE 14
  22. #define C_YELLOW 15
  23. #define C_WHITE 16
  24. #define BOLD_OPEN 1
  25. #define BOLD_CLOSE 2
  26. #define UNDERLINE_OPEN 3
  27. #define UNDERLINE_CLOSE 4
  28. #define COLOR_OPEN 5
  29. #define COLOR_CLOSE 6
  30. #define FLASH_OPEN 7
  31. #define FLASH_CLOSE 8
  32. #define BLACK(idx) color(idx, COLOR_OPEN, C_BLACK)
  33. #define BLUE(idx) color(idx, COLOR_OPEN, C_BLUE)
  34. #define GREEN(idx) color(idx, COLOR_OPEN, C_GREEN)
  35. #define CYAN(idx) color(idx, COLOR_OPEN, C_CYAN)
  36. #define RED(idx) color(idx, COLOR_OPEN, C_RED)
  37. #define PURPLE(idx) color(idx, COLOR_OPEN, C_PURPLE)
  38. #define BROWN(idx) color(idx, COLOR_OPEN, C_BROWN)
  39. #define LIGHTGREY(idx) color(idx, COLOR_OPEN, C_LIGHTGREY)
  40. #define DARKGREY(idx) color(idx, COLOR_OPEN, C_DARKGREY)
  41. #define LIGHTBLUE(idx) color(idx, COLOR_OPEN, C_LIGHTBLUE)
  42. #define LIGHTGREEN(idx) color(idx, COLOR_OPEN, C_LIGHTGREEN)
  43. #define LIGHTCYAN(idx) color(idx, COLOR_OPEN, C_LIGHTCYAN)
  44. #define LIGHTRED(idx) color(idx, COLOR_OPEN, C_LIGHTRED)
  45. #define LIGHTPURPLE(idx) color(idx, COLOR_OPEN, C_LIGHTPURPLE)
  46. #define YELLOW(idx) color(idx, COLOR_OPEN, C_YELLOW)
  47. #define WHITE(idx) color(idx, COLOR_OPEN, C_WHITE)
  48. #define COLOR_END(idx) color(idx, COLOR_CLOSE, 0)
  49. #define BOLD(idx) color(idx, BOLD_OPEN, 0)
  50. #define BOLD_END(idx) color(idx, BOLD_CLOSE, 0)
  51. #define UNDERLINE(idx) color(idx, UNDERLINE_OPEN, 0)
  52. #define UNDERLINE_END(idx) color(idx, UNDERLINE_CLOSE, 0)
  53. #define FLASH(idx) color(idx, FLASH_OPEN, 0)
  54. #define FLASH_END(idx) color(idx, FLASH_CLOSE, 0)
  55. #endif /* !_COLOR_H */