Source:NetHack 5.0.0/include/color.h

From NetHackWiki
Jump to navigation Jump to search

Below is the full text to color.h from the source code of NetHack 5.0.0. To link to a particular line, write [[Source:NetHack 5.0.0/include/color.h#line12]], for example.

The NetHack General Public License applies to screenshots, source code and other content from NetHack.

This content was modified from the original NetHack source code distribution (by splitting up NetHack content between wiki pages, and possibly further editing). See the page history for a list of who changed it, and on what dates.

1. /* NetHack 5.0	color.h	$NHDT-Date: 1682205020 2023/04/22 23:10:20 $  $NHDT-Branch: NetHack-3.7 $:$NHDT-Revision: 1.18 $ */
2. /* Copyright (c) Steve Linhart, Eric Raymond, 1989. */
3. /* NetHack may be freely redistributed.  See license for details. */
4. 
5. #ifndef COLOR_H
6. #define COLOR_H
7. 
8. /*
9.  * The color scheme used is tailored for an IBM PC.  It consists of the
10.  * standard 8 colors, followed by their bright counterparts.  There are
11.  * exceptions, these are listed below.	Bright black doesn't mean very
12.  * much, so it is used as the "default" foreground color of the screen.
13.  */
14. #define CLR_BLACK 0
15. #define CLR_RED 1
16. #define CLR_GREEN 2
17. #define CLR_BROWN 3 /* on IBM, low-intensity yellow is brown */
18. #define CLR_BLUE 4
19. #define CLR_MAGENTA 5
20. #define CLR_CYAN 6
21. #define CLR_GRAY 7 /* low-intensity white */
22. #define NO_COLOR 8
23. #define CLR_ORANGE 9
24. #define CLR_BRIGHT_GREEN 10
25. #define CLR_YELLOW 11
26. #define CLR_BRIGHT_BLUE 12
27. #define CLR_BRIGHT_MAGENTA 13
28. #define CLR_BRIGHT_CYAN 14
29. #define CLR_WHITE 15
30. #define CLR_MAX 16
31. 
32. /* The "half-way" point for tty-based color systems.  This is used in */
33. /* the tty color setup code.  (IMHO, it should be removed - dean).    */
34. #define BRIGHT 8
35. 
36. /* color aliases used in monsters.h and display.c  */
37. #define HI_DOMESTIC CLR_WHITE /* for player + pets */
38. #define HI_LORD CLR_MAGENTA /* for high-end monsters */
39. #define HI_OVERLORD CLR_BRIGHT_MAGENTA /* for few uniques */
40. 
41. /* these can be configured */
42. #define HI_OBJ CLR_MAGENTA
43. #define HI_METAL CLR_CYAN
44. #define HI_COPPER CLR_YELLOW
45. #define HI_SILVER CLR_GRAY
46. #define HI_GOLD CLR_YELLOW
47. #define HI_LEATHER CLR_BROWN
48. #define HI_CLOTH CLR_BROWN
49. #define HI_ORGANIC CLR_BROWN
50. #define HI_WOOD CLR_BROWN
51. #define HI_PAPER CLR_WHITE
52. #define HI_GLASS CLR_BRIGHT_CYAN
53. #define HI_MINERAL CLR_GRAY
54. #define DRAGON_SILVER CLR_BRIGHT_CYAN
55. #define HI_ZAP CLR_BRIGHT_BLUE
56. 
57. #define NH_BASIC_COLOR  0x1000000
58. #define NH_ALTPALETTE   0x2000000
59. #define COLORVAL(x) ((x) & 0xFFFFFF)
60. 
61. enum nhcolortype { no_color, nh_color, rgb_color };
62. 
63. struct nethack_color {
64.     enum nhcolortype colortyp;
65.     int tableindex;
66.     int rgbindex;
67.     const char *name;
68.     long r, g, b;
69. };
70. 
71. typedef struct color_and_attr {
72.            int color, attr;
73. } color_attr;
74. 
75. extern const struct nethack_color colortable[];
76. 
77. #endif /* COLOR_H */
78. 
79. /*color.h*/