|
1 |
| -# Colors used in gruvbox-256 |
2 |
| -# See https://github.com/morhetz/gruvbox/blob/master/colors/gruvbox.vim |
3 |
| -BLACK = "h234" # dark0_hard |
4 |
| -WHITE = "h246" # light4_256 |
5 |
| -WHITEBOLD = f"{WHITE}, bold" |
6 |
| -DARKBLUE = "h24" # faded_blue |
7 |
| -DARKRED = "h88" # faded_red |
8 |
| -LIGHTBLUE = "h109" # bright_blue |
9 |
| -LIGHTBLUEBOLD = f"{LIGHTBLUE}, bold" |
10 |
| -YELLOW = "h172" # neutral_yellow |
11 |
| -YELLOWBOLD = f"{YELLOW}, bold" |
12 |
| -LIGHTGREEN = "h142" # bright_green |
13 |
| -LIGHTRED = "h167" # bright_red |
14 |
| -LIGHTREDBOLD = f"{LIGHTRED}, bold" |
15 |
| -GRAY = "h244" # gray_244 |
16 |
| -LIGHTMAGENTA = "h132" # neutral_purple |
17 |
| -LIGHTMAGENTABOLD = f"{LIGHTMAGENTA}, bold" |
| 1 | +from enum import Enum |
18 | 2 |
|
19 |
| -# Colors used in gruvbox_dark24 |
20 |
| -BLACK24 = "#1d2021" # dark0_hard |
21 |
| -WHITE24 = "#a89984" # light4 |
22 |
| -WHITEBOLD24 = f"{WHITE24}, bold" |
23 |
| -DARKBLUE24 = "#076678" # faded_blue |
24 |
| -DARKRED24 = "#9d0006" # faded_red |
25 |
| -LIGHTBLUE24 = "#83a598" # bright_blue |
26 |
| -LIGHTBLUEBOLD24 = f"{LIGHTBLUE24}, bold" |
27 |
| -YELLOW24 = "#d79921" # neutral_yellow |
28 |
| -YELLOWBOLD24 = f"{YELLOW24}, bold" |
29 |
| -LIGHTGREEN24 = "#b8bb26" # bright_green |
30 |
| -LIGHTRED24 = "#fb4934" # bright_red |
31 |
| -LIGHTREDBOLD24 = f"{LIGHTRED24}, bold" |
32 |
| -GRAY24 = "#928374" # gray_244 |
33 |
| -LIGHTMAGENTA24 = "#b16286" # neutral_purple |
34 |
| -LIGHTMAGENTABOLD24 = f"{LIGHTMAGENTA24}, bold" |
| 3 | +from zulipterminal.config.themes import add_color_prop |
35 | 4 |
|
36 |
| -styles = { |
37 |
| - None: { |
38 |
| - 16: ["white", "black"], |
39 |
| - 256: [WHITE, BLACK], |
40 |
| - 24: [WHITE24, BLACK24], |
41 |
| - }, |
42 |
| - "selected": { |
43 |
| - 16: ["black", "white"], |
44 |
| - 256: [BLACK, WHITE], |
45 |
| - 24: [BLACK24, WHITE24], |
46 |
| - }, |
47 |
| - "msg_selected": { |
48 |
| - 16: ["black", "white"], |
49 |
| - 256: [BLACK, WHITE], |
50 |
| - 24: [BLACK24, WHITE24], |
51 |
| - }, |
52 |
| - "header": { |
53 |
| - 16: ["dark cyan", "dark blue"], |
54 |
| - 256: ["dark cyan", DARKBLUE], |
55 |
| - 24: ["dark cyan", DARKBLUE24], |
56 |
| - }, |
57 |
| - "general_narrow": { |
58 |
| - 16: ["white", "dark blue"], |
59 |
| - 256: [WHITE, DARKBLUE], |
60 |
| - 24: [WHITE24, DARKBLUE24], |
61 |
| - }, |
62 |
| - "general_bar": { |
63 |
| - 16: ["white", "black"], |
64 |
| - 256: [WHITE, BLACK], |
65 |
| - 24: [WHITE24, BLACK24], |
66 |
| - }, |
67 |
| - "name": { |
68 |
| - 16: ["yellow, bold", "black"], |
69 |
| - 256: [YELLOWBOLD, BLACK], |
70 |
| - 24: [YELLOWBOLD24, BLACK24], |
71 |
| - }, |
72 |
| - "unread": { |
73 |
| - 16: ["light magenta", "black"], |
74 |
| - 256: [LIGHTMAGENTA, BLACK], |
75 |
| - 24: [LIGHTMAGENTA24, BLACK24], |
76 |
| - }, |
77 |
| - "user_active": { |
78 |
| - 16: ["light green", "black"], |
79 |
| - 256: [LIGHTGREEN, BLACK], |
80 |
| - 24: [LIGHTGREEN24, BLACK24], |
81 |
| - }, |
82 |
| - "user_idle": { |
83 |
| - 16: ["yellow", "black"], |
84 |
| - 256: [YELLOW, BLACK], |
85 |
| - 24: [YELLOW24, BLACK24], |
86 |
| - }, |
87 |
| - "user_offline": { |
88 |
| - 16: ["white", "black"], |
89 |
| - 256: [WHITE, BLACK], |
90 |
| - 24: [WHITE24, BLACK24], |
91 |
| - }, |
92 |
| - "user_inactive": { |
93 |
| - 16: ["white", "black"], |
94 |
| - 256: [WHITE, BLACK], |
95 |
| - 24: [WHITE24, BLACK24], |
96 |
| - }, |
97 |
| - "title": { |
98 |
| - 16: ["white, bold", "black"], |
99 |
| - 256: [WHITEBOLD, BLACK], |
100 |
| - 24: [WHITEBOLD24, BLACK24], |
101 |
| - }, |
102 |
| - "column_title": { |
103 |
| - 16: ["white, bold", "black"], |
104 |
| - 256: [WHITEBOLD, BLACK], |
105 |
| - 24: [WHITEBOLD24, BLACK24], |
106 |
| - }, |
107 |
| - "time": { |
108 |
| - 16: ["light blue", "black"], |
109 |
| - 256: [LIGHTBLUE, BLACK], |
110 |
| - 24: [LIGHTBLUE24, BLACK24], |
111 |
| - }, |
112 |
| - "bar": { |
113 |
| - 16: ["white", "dark gray"], |
114 |
| - 256: [WHITE, GRAY], |
115 |
| - 24: [WHITE24, GRAY24], |
116 |
| - }, |
117 |
| - "popup_contrast": { |
118 |
| - 16: ["black", "dark gray"], |
119 |
| - 256: [BLACK, GRAY], |
120 |
| - 24: [BLACK24, GRAY24], |
121 |
| - }, |
122 |
| - "msg_emoji": { |
123 |
| - 16: ["light magenta", "black"], |
124 |
| - 256: [LIGHTMAGENTA, BLACK], |
125 |
| - 24: [LIGHTMAGENTA24, BLACK24], |
126 |
| - }, |
127 |
| - "reaction": { |
128 |
| - 16: ["light magenta, bold", "black"], |
129 |
| - 256: [LIGHTMAGENTABOLD, BLACK], |
130 |
| - 24: [LIGHTMAGENTABOLD24, BLACK24], |
131 |
| - }, |
132 |
| - "reaction_mine": { |
133 |
| - 16: ["black", "light magenta"], |
134 |
| - 256: [BLACK, LIGHTMAGENTA], |
135 |
| - 24: [BLACK24, LIGHTMAGENTA24], |
136 |
| - }, |
137 |
| - "msg_mention": { |
138 |
| - 16: ["light red, bold", "black"], |
139 |
| - 256: [LIGHTREDBOLD, BLACK], |
140 |
| - 24: [LIGHTREDBOLD24, BLACK24], |
141 |
| - }, |
142 |
| - "msg_link": { |
143 |
| - 16: ["light blue", "black"], |
144 |
| - 256: [LIGHTBLUE, BLACK], |
145 |
| - 24: [LIGHTBLUE24, BLACK24], |
146 |
| - }, |
147 |
| - "msg_link_index": { |
148 |
| - 16: ["light blue, bold", "black"], |
149 |
| - 256: [LIGHTBLUEBOLD, BLACK], |
150 |
| - 24: [LIGHTBLUEBOLD24, BLACK24], |
151 |
| - }, |
152 |
| - "msg_quote": { |
153 |
| - 16: ["brown", "black"], |
154 |
| - 256: ["brown", BLACK], |
155 |
| - 24: ["brown", BLACK24], |
156 |
| - }, |
157 |
| - "msg_code": { |
158 |
| - 16: ["black", "white"], |
159 |
| - 256: [BLACK, WHITE], |
160 |
| - 24: [BLACK24, WHITE24], |
161 |
| - }, |
162 |
| - "msg_bold": { |
163 |
| - 16: ["white, bold", "black"], |
164 |
| - 256: [WHITEBOLD, BLACK], |
165 |
| - 24: [WHITEBOLD24, BLACK24], |
166 |
| - }, |
167 |
| - "msg_time": { |
168 |
| - 16: ["black", "white"], |
169 |
| - 256: [BLACK, WHITE], |
170 |
| - 24: [BLACK24, WHITE24], |
171 |
| - }, |
172 |
| - "footer": { |
173 |
| - 16: ["white", "dark red"], |
174 |
| - 256: [WHITE, DARKRED], |
175 |
| - 24: [WHITE24, DARKRED24], |
176 |
| - }, |
177 |
| - "starred": { |
178 |
| - 16: ["light red, bold", "black"], |
179 |
| - 256: [LIGHTREDBOLD, BLACK], |
180 |
| - 24: [LIGHTREDBOLD24, BLACK24], |
181 |
| - }, |
182 |
| - "popup_category": { |
183 |
| - 16: ["light blue, bold", "black"], |
184 |
| - 256: [LIGHTBLUE, BLACK], |
185 |
| - 24: [LIGHTBLUE24, BLACK24], |
186 |
| - }, |
187 |
| - "unread_count": { |
188 |
| - 16: ["yellow", "black"], |
189 |
| - 256: [YELLOW, BLACK], |
190 |
| - 24: [YELLOW24, BLACK24], |
191 |
| - }, |
192 |
| - "starred_count": { |
193 |
| - 16: ["light gray", "black"], |
194 |
| - 256: [GRAY, BLACK], |
195 |
| - 24: [WHITE24, BLACK24], |
196 |
| - }, |
197 |
| - "table_head": { |
198 |
| - 16: ["white, bold", "black"], |
199 |
| - 256: [WHITEBOLD, BLACK], |
200 |
| - 24: [WHITEBOLD24, BLACK24], |
201 |
| - }, |
202 |
| - "filter_results": { |
203 |
| - 16: ["black", "light green"], |
204 |
| - 256: [BLACK, LIGHTGREEN], |
205 |
| - 24: [BLACK24, LIGHTGREEN24], |
206 |
| - }, |
207 |
| - "edit_topic": { |
208 |
| - 16: ["black", "dark gray"], |
209 |
| - 256: [BLACK, GRAY], |
210 |
| - 24: [BLACK24, GRAY24], |
211 |
| - }, |
212 |
| - "edit_tag": { |
213 |
| - 16: ["black", "dark gray"], |
214 |
| - 256: [BLACK, GRAY], |
215 |
| - 24: [BLACK24, GRAY24], |
216 |
| - }, |
217 |
| - "edit_author": { |
218 |
| - 16: ["yellow", "black"], |
219 |
| - 256: [YELLOW, BLACK], |
220 |
| - 24: [YELLOW24, BLACK24], |
221 |
| - }, |
222 |
| - "edit_time": { |
223 |
| - 16: ["light blue", "black"], |
224 |
| - 256: [LIGHTBLUE, BLACK], |
225 |
| - 24: [LIGHTBLUE24, BLACK24], |
226 |
| - }, |
227 |
| - "current_user": { |
228 |
| - 16: ["white", "black"], |
229 |
| - 256: [WHITE, BLACK], |
230 |
| - 24: [WHITE24, BLACK24], |
231 |
| - }, |
232 |
| - "muted": { |
233 |
| - 16: ["light blue", "black"], |
234 |
| - 256: [LIGHTBLUE, BLACK], |
235 |
| - 24: [LIGHTBLUE24, BLACK24], |
236 |
| - }, |
237 |
| - "popup_border": { |
238 |
| - 16: ["white", "black"], |
239 |
| - 256: [WHITE, BLACK], |
240 |
| - 24: [WHITE24, BLACK24], |
241 |
| - }, |
242 |
| - "area:help": { |
243 |
| - 16: ["black", "light green"], |
244 |
| - 256: [BLACK, LIGHTGREEN], |
245 |
| - 24: [BLACK24, LIGHTGREEN24], |
246 |
| - }, |
247 |
| - "area:msg": { |
248 |
| - 16: ["black", "light red"], |
249 |
| - 256: [BLACK, LIGHTRED], |
250 |
| - 24: [BLACK24, LIGHTRED24], |
251 |
| - }, |
252 |
| - "area:stream": { |
253 |
| - 16: ["black", "light blue"], |
254 |
| - 256: [BLACK, LIGHTBLUE], |
255 |
| - 24: [BLACK24, LIGHTBLUE24], |
256 |
| - }, |
257 |
| - "area:error": { |
258 |
| - 16: ["white", "dark red"], |
259 |
| - 256: [WHITE, DARKRED], |
260 |
| - 24: [WHITE24, DARKRED24], |
261 |
| - }, |
262 |
| - "search_error": { |
263 |
| - 16: ["light red", "black"], |
264 |
| - 256: [LIGHTRED, BLACK], |
265 |
| - 24: [LIGHTRED24, BLACK24], |
266 |
| - }, |
| 5 | + |
| 6 | +# fmt: off |
| 7 | +class Color(Enum): |
| 8 | + BLACK = 'h234 #1d2021' |
| 9 | + WHITE = 'h246 #a89984' |
| 10 | + DARK_BLUE = 'h24 #076678' |
| 11 | + DARK_RED = 'h88 #9d0006' |
| 12 | + LIGHT_BLUE = 'h109 #83a598' |
| 13 | + YELLOW = 'h172 #d79921' |
| 14 | + LIGHT_GREEN = 'h142 #b8bb26' |
| 15 | + LIGHT_RED = 'h167 #fb4934' |
| 16 | + DARK_GRAY = 'h244 #928374' |
| 17 | + LIGHT_MAGENTA = 'h132 #b16286' |
| 18 | + DARK_CYAN = 'dark_cyan dark_cyan' |
| 19 | + BROWN = 'brown brown' |
| 20 | + |
| 21 | +Color = add_color_prop(Color, "BOLD") |
| 22 | +# Use dunder for bold |
| 23 | +# Eg: Color.YELLOW__BOLD |
| 24 | + |
| 25 | +STYLES = { |
| 26 | + None : (Color.WHITE, Color.BLACK), |
| 27 | + 'selected' : (Color.BLACK, Color.WHITE), |
| 28 | + 'msg_selected' : (Color.BLACK, Color.WHITE), |
| 29 | + 'header' : (Color.DARK_CYAN, Color.DARK_BLUE), |
| 30 | + 'general_narrow' : (Color.WHITE, Color.DARK_BLUE), |
| 31 | + 'general_bar' : (Color.WHITE, Color.BLACK), |
| 32 | + 'name' : (Color.YELLOW__BOLD, Color.BLACK), |
| 33 | + 'unread' : (Color.LIGHT_MAGENTA, Color.BLACK), |
| 34 | + 'user_active' : (Color.LIGHT_GREEN, Color.BLACK), |
| 35 | + 'user_idle' : (Color.YELLOW, Color.BLACK), |
| 36 | + 'user_offline' : (Color.WHITE, Color.BLACK), |
| 37 | + 'user_inactive' : (Color.WHITE, Color.BLACK), |
| 38 | + 'title' : (Color.WHITE__BOLD, Color.BLACK), |
| 39 | + 'column_title' : (Color.WHITE__BOLD, Color.BLACK), |
| 40 | + 'time' : (Color.LIGHT_BLUE, Color.BLACK), |
| 41 | + 'bar' : (Color.WHITE, Color.DARK_GRAY), |
| 42 | + 'popup_contrast' : (Color.BLACK, Color.DARK_GRAY), |
| 43 | + 'msg_emoji' : (Color.LIGHT_MAGENTA, Color.BLACK), |
| 44 | + 'reaction' : (Color.LIGHT_MAGENTA__BOLD, Color.BLACK), |
| 45 | + 'reaction_mine' : (Color.BLACK, Color.LIGHT_MAGENTA), |
| 46 | + 'msg_mention' : (Color.LIGHT_RED__BOLD, Color.BLACK), |
| 47 | + 'msg_link' : (Color.LIGHT_BLUE, Color.BLACK), |
| 48 | + 'msg_link_index' : (Color.LIGHT_BLUE__BOLD, Color.BLACK), |
| 49 | + 'msg_quote' : (Color.BROWN, Color.BLACK), |
| 50 | + 'msg_code' : (Color.BLACK, Color.WHITE), |
| 51 | + 'msg__bold' : (Color.WHITE__BOLD, Color.BLACK), |
| 52 | + 'msg_time' : (Color.BLACK, Color.WHITE), |
| 53 | + 'footer' : (Color.WHITE, Color.DARK_RED), |
| 54 | + 'starred' : (Color.LIGHT_RED__BOLD, Color.BLACK), |
| 55 | + 'popup_category' : (Color.LIGHT_BLUE, Color.BLACK), |
| 56 | + 'unread_count' : (Color.YELLOW, Color.BLACK), |
| 57 | + 'starred_count' : (Color.DARK_GRAY, Color.BLACK), |
| 58 | + 'table_head' : (Color.WHITE__BOLD, Color.BLACK), |
| 59 | + 'filter_results' : (Color.BLACK, Color.LIGHT_GREEN), |
| 60 | + 'edit_topic' : (Color.BLACK, Color.DARK_GRAY), |
| 61 | + 'edit_tag' : (Color.BLACK, Color.DARK_GRAY), |
| 62 | + 'edit_author' : (Color.YELLOW, Color.BLACK), |
| 63 | + 'edit_time' : (Color.LIGHT_BLUE, Color.BLACK), |
| 64 | + 'current_user' : (Color.WHITE, Color.BLACK), |
| 65 | + 'muted' : (Color.LIGHT_BLUE, Color.BLACK), |
| 66 | + 'popup_border' : (Color.WHITE, Color.BLACK), |
| 67 | + 'area:help' : (Color.BLACK, Color.LIGHT_GREEN), |
| 68 | + 'area:msg' : (Color.BLACK, Color.LIGHT_RED), |
| 69 | + 'area:stream' : (Color.BLACK, Color.LIGHT_BLUE), |
| 70 | + 'area:error' : (Color.WHITE, Color.DARK_RED), |
| 71 | + 'search_error' : (Color.LIGHT_RED, Color.BLACK), |
267 | 72 | }
|
| 73 | +# fmt: on |
0 commit comments