1 /* SCCS Id: @(#)color.h 3.4 1992/02/02 */ 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 #ifdef MENU_COLOR 9 # ifdef MENU_COLOR_REGEX 10 # include <regex.h> 11 # endif 12 #endif 13 14 /* 15 * The color scheme used is tailored for an IBM PC. It consists of the 16 * standard 8 colors, folowed by their bright counterparts. There are 17 * exceptions, these are listed below. Bright black doesn't mean very 18 * much, so it is used as the "default" foreground color of the screen. 19 */ 20 21 #if !defined(VIDEOSHADES) || defined(WIN32CON) 22 #define CLR_BLACK 0 23 #else 24 # define CLR_BLACK 8 25 #endif 26 #define CLR_RED 1 27 #define CLR_GREEN 2 28 #define CLR_BROWN 3 /* on IBM, low-intensity yellow is brown */ 29 #define CLR_BLUE 4 30 #define CLR_MAGENTA 5 31 #define CLR_CYAN 6 32 #define CLR_GRAY 7 /* low-intensity white */ 33 #if !defined(VIDEOSHADES) || defined(WIN32CON) 34 #define NO_COLOR 8 35 #else 36 # define NO_COLOR 0 37 #endif 38 #define CLR_ORANGE 9 39 #define CLR_BRIGHT_GREEN 10 40 #define CLR_YELLOW 11 41 #define CLR_BRIGHT_BLUE 12 42 #define CLR_BRIGHT_MAGENTA 13 43 #define CLR_BRIGHT_CYAN 14 44 #define CLR_WHITE 15 45 #define CLR_MAX 16 46 47 /* The "half-way" point for tty based color systems. This is used in */ 48 /* the tty color setup code. (IMHO, it should be removed - dean). */ 49 #define BRIGHT 8 50 51 /* these can be configured */ 52 #define HI_OBJ CLR_MAGENTA 53 #define HI_METAL CLR_CYAN 54 #define HI_COPPER CLR_YELLOW 55 #define HI_SILVER CLR_GRAY 56 #define HI_GOLD CLR_YELLOW 57 #define HI_LEATHER CLR_BROWN 58 #define HI_CLOTH CLR_BROWN 59 #define HI_ORGANIC CLR_BROWN 60 #define HI_WOOD CLR_BROWN 61 #define HI_PAPER CLR_WHITE 62 #define HI_GLASS CLR_BRIGHT_CYAN 63 #define HI_MINERAL CLR_GRAY 64 #define DRAGON_SILVER CLR_BRIGHT_CYAN 65 #define HI_ZAP CLR_BRIGHT_BLUE 66 67 #ifdef MENU_COLOR 68 struct menucoloring { 69 # ifdef MENU_COLOR_REGEX 70 # ifdef MENU_COLOR_REGEX_POSIX 71 regex_t match; 72 # else 73 struct re_pattern_buffer match; 74 # endif 75 # else 76 char *match; 77 # endif 78 int color, attr; 79 struct menucoloring *next; 80 }; 81 #endif /* MENU_COLOR */ 82 83 #ifdef STATUS_COLORS 84 struct color_option { 85 int color; 86 int attr_bits; 87 }; 88 89 struct percent_color_option { 90 int percentage; 91 struct color_option color_option; 92 const struct percent_color_option *next; 93 }; 94 95 struct text_color_option { 96 const char *text; 97 struct color_option color_option; 98 const struct text_color_option *next; 99 }; 100 #endif 101 102 #ifndef MSDOS 103 extern int ttycolors[CLR_MAX]; 104 #endif 105 106 #endif /* COLOR_H */ 107