1 /*
2  * $Id: color.h 768 2007-10-24 00:10:03Z hubert@u.washington.edu $
3  *
4  * ========================================================================
5  * Copyright 2013-2021 Eduardo Chappa
6  * Copyright 2006 University of Washington
7  *
8  * Licensed under the Apache License, Version 2.0 (the "License");
9  * you may not use this file except in compliance with the License.
10  * You may obtain a copy of the License at
11  *
12  *     http://www.apache.org/licenses/LICENSE-2.0
13  *
14  * ========================================================================
15  */
16 
17 #ifndef PITH_COLOR_INCLUDED
18 #define PITH_COLOR_INCLUDED
19 
20 
21 #include "../pith/filttype.h"
22 #include "../pith/pattern.h"
23 #include "../pith/osdep/color.h"
24 
25 
26 typedef struct spec_color_s {
27     int   inherit;	/* this isn't a color, it is INHERIT */
28     char *spec;
29     char *fg;
30     char *bg;
31     PATTERN_S *val;
32     struct spec_color_s *next;
33 } SPEC_COLOR_S;
34 
35 
36 /*
37  * These are default colors that you'll get when you turn
38  * color on. The way color works is that the closest possible
39  * RGB value is chosen so these colors will produce different
40  * results in the different color models (the 8-color, 16-color,
41  * xterm 256-color, and PC-Alpine color).
42  * See init_color_table() for the RGB values we use.
43  * The 8-color model uses the 8 0 or 255 possibilities. So,
44  * for example, if the default color is "000,217,217" the
45  * closes 8-color version of that is going to be "000,255,255".
46  * In the 16-color terminal we use 000, 174, and 255 as the
47  * possible values. That means that a default value
48  * of "000,214,000" maps to "000,174,000" (a dull green)
49  * but "000,215,000" maps to "000,255,000" (a bright green).
50  *
51  * The colors which don't have defaults map to either the current
52  * setting of the Normal color or the current setting of the
53  * Reverse color, depending on what we thought was right long ago.
54  */
55 #define DEFAULT_TITLE_FORE_RGB		"000,000,000"
56 #define DEFAULT_TITLE_BACK_RGB		"255,255,000"
57 #define DEFAULT_TITLECLOSED_FORE_RGB	"255,255,255"
58 #define DEFAULT_TITLECLOSED_BACK_RGB	"255,000,000"
59 #define DEFAULT_METAMSG_FORE_RGB	"000,000,000"
60 #define DEFAULT_METAMSG_BACK_RGB	"255,255,000"
61 #define DEFAULT_QUOTE1_FORE_RGB		"000,000,000"
62 #define DEFAULT_QUOTE1_BACK_RGB		"000,217,217"
63 #define DEFAULT_QUOTE2_FORE_RGB		"000,000,000"
64 #define DEFAULT_QUOTE2_BACK_RGB		"204,214,000"
65 #define DEFAULT_QUOTE3_FORE_RGB		"000,000,000"
66 #define DEFAULT_QUOTE3_BACK_RGB		"000,214,000"
67 #define DEFAULT_SIGNATURE_FORE_RGB	"000,000,255"
68 #define DEFAULT_SIGNATURE_BACK_RGB	"255,255,255"
69 #define DEFAULT_IND_PLUS_FORE_RGB	"000,000,000"
70 #define DEFAULT_IND_PLUS_BACK_RGB	"000,174,174"
71 #define DEFAULT_IND_IMP_FORE_RGB	"240,240,240"
72 #define DEFAULT_IND_IMP_BACK_RGB	"174,000,000"
73 #define DEFAULT_IND_ANS_FORE_RGB	"255,000,000"
74 #define DEFAULT_IND_ANS_BACK_RGB	"174,174,000"
75 #define DEFAULT_IND_NEW_FORE_RGB	"240,240,240"
76 #define DEFAULT_IND_NEW_BACK_RGB	"174,000,174"
77 #define DEFAULT_IND_OP_FORE_RGB		"192,192,192"
78 #define DEFAULT_IND_OP_BACK_RGB		"255,255,255"
79 
80 
81 /* exported prototypes */
82 char	*color_embed(char *, char *);
83 int	 colorcmp(char *, char *);
84 int	 color_a_quote(long, char *, LT_INS_S **, void *);
85 void	 free_spec_colors(SPEC_COLOR_S **);
86 
87 
88 #endif /* PITH_COLOR_INCLUDED */
89