colors.h 1.2 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849
  1. #ifndef GRASS_COLORS_H
  2. #define GRASS_COLORS_H
  3. /* Don't add more colors here.
  4. These colors are the preallocated colors used in displays for efficiency.
  5. Adding colors here reduces the number of colors it is possible for a user to display.
  6. If support for named colors is needed it should go in G_str_to_color. */
  7. #define BLACK 1
  8. #define RED 2
  9. #define GREEN 3
  10. #define BLUE 4
  11. #define YELLOW 5
  12. #define CYAN 6
  13. #define MAGENTA 7
  14. #define WHITE 8
  15. #define GRAY 9
  16. #define ORANGE 10
  17. #define AQUA 11
  18. #define INDIGO 12
  19. #define VIOLET 13
  20. #define BROWN 14
  21. #define GREY GRAY
  22. #define PURPLE VIOLET
  23. /* These can be in any order. They must match the lookup strings in the table below. */
  24. #define D_COLOR_LIST "red,orange,yellow,green,blue,indigo,violet,white,black,gray,brown,magenta,aqua,grey,cyan,purple"
  25. /* max length of color string */
  26. #define MAX_COLOR_LEN 32
  27. struct color_rgb {
  28. unsigned char r, g, b;
  29. };
  30. struct color_name {
  31. const char *name;
  32. int number;
  33. };
  34. extern int G_num_standard_colors(void);
  35. extern struct color_rgb G_standard_color_rgb(int n);
  36. extern int G_num_standard_color_names(void);
  37. extern const struct color_name *G_standard_color_name(int n);
  38. #endif