t_color2.c 3.3 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394
  1. /* This file is part of the GNU plotutils package. Copyright (C) 1995,
  2. 1996, 1997, 1998, 1999, 2000, 2005, 2008, Free Software Foundation, Inc.
  3. The GNU plotutils package is free software. You may redistribute it
  4. and/or modify it under the terms of the GNU General Public License as
  5. published by the Free Software foundation; either version 2, or (at your
  6. option) any later version.
  7. The GNU plotutils package is distributed in the hope that it will be
  8. useful, but WITHOUT ANY WARRANTY; without even the implied warranty of
  9. MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
  10. General Public License for more details.
  11. You should have received a copy of the GNU General Public License along
  12. with the GNU plotutils package; see the file COPYING. If not, write to
  13. the Free Software Foundation, Inc., 51 Franklin St., Fifth Floor,
  14. Boston, MA 02110-1301, USA. */
  15. /* The 16 standard colors (ANSI, ISO 6429) supported by the Tektronix mode
  16. of MS-DOS Kermit. (Reportedly `color xterm' supports them too, but
  17. maybe not in Tektronix emulation mode?)
  18. It includes the 8 standard colors (vertices of the RGB cube). It also
  19. includes an intermediate brightness for each of the 6 colors other than
  20. black and white, and two intermediate brightnesses for white (i.e., two
  21. shades of gray intermediate between black and white). The two shades of
  22. gray are the only colors in the interior of the cube. */
  23. #include "sys-defines.h"
  24. #include "extern.h"
  25. const plColor _pl_t_kermit_stdcolors[TEK_NUM_ANSI_SYS_COLORS] =
  26. {
  27. {0x00, 0x00, 0x00}, /* black */
  28. {0x8b, 0x00, 0x00}, /* red4 */
  29. {0x00, 0x8b, 0x00}, /* green4 */
  30. {0x8b, 0x8b, 0x00}, /* yellow4 */
  31. {0x00, 0x00, 0x8b}, /* blue4 */
  32. {0x8b, 0x00, 0x8b}, /* magenta4 */
  33. {0x00, 0x8b, 0x8b}, /* cyan4 */
  34. {0x8b, 0x8b, 0x8b}, /* gray55 */
  35. {0x4d, 0x4d, 0x4d}, /* gray30 */
  36. {0xff, 0x00, 0x00}, /* red */
  37. {0x00, 0xff, 0x00}, /* green */
  38. {0xff, 0xff, 0x00}, /* yellow */
  39. {0x00, 0x00, 0xff}, /* blue */
  40. {0xff, 0x00, 0xff}, /* magenta */
  41. {0x00, 0xff, 0xff}, /* cyan */
  42. {0xff, 0xff, 0xff} /* white */
  43. };
  44. /* Ordering of these two lists of ANSI escape sequences must match the
  45. above. */
  46. const char * const _pl_t_kermit_fgcolor_escapes[TEK_NUM_ANSI_SYS_COLORS] =
  47. {
  48. "\033[0;30m", /* black */
  49. "\033[0;31m", /* red4 */
  50. "\033[0;32m", /* green4 */
  51. "\033[0;33m", /* yellow4 */
  52. "\033[0;34m", /* blue4 */
  53. "\033[0;35m", /* magenta4 */
  54. "\033[0;36m", /* cyan4 */
  55. "\033[0;37m", /* gray55 */
  56. "\033[1;30m", /* gray30 */
  57. "\033[1;31m", /* red */
  58. "\033[1;32m", /* green */
  59. "\033[1;33m", /* yellow */
  60. "\033[1;34m", /* blue */
  61. "\033[1;35m", /* magenta */
  62. "\033[1;36m", /* cyan */
  63. "\033[1;37m" /* white */
  64. };
  65. const char * const _pl_t_kermit_bgcolor_escapes[TEK_NUM_ANSI_SYS_COLORS] =
  66. {
  67. "\033[0;40m", /* black */
  68. "\033[0;41m", /* red4 */
  69. "\033[0;42m", /* green4 */
  70. "\033[0;43m", /* yellow4 */
  71. "\033[0;44m", /* blue4 */
  72. "\033[0;45m", /* magenta4 */
  73. "\033[0;46m", /* cyan4 */
  74. "\033[0;47m", /* gray55 */
  75. "\033[1;40m", /* gray30 */
  76. "\033[1;41m", /* red */
  77. "\033[1;42m", /* green */
  78. "\033[1;43m", /* yellow */
  79. "\033[1;44m", /* blue */
  80. "\033[1;45m", /* magenta */
  81. "\033[1;46m", /* cyan */
  82. "\033[1;47m" /* white */
  83. };