colors.h 1.0 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647
  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. {
  29. unsigned char r, g, b;
  30. };
  31. struct color_name
  32. {
  33. const char *name;
  34. int number;
  35. };
  36. #include <grass/defs/colors.h>
  37. #endif