diff options
Diffstat (limited to 'presentty/palette.py')
-rw-r--r-- | presentty/palette.py | 78 |
1 files changed, 78 insertions, 0 deletions
diff --git a/presentty/palette.py b/presentty/palette.py new file mode 100644 index 0000000..6079a95 --- /dev/null +++ b/presentty/palette.py | |||
@@ -0,0 +1,78 @@ | |||
1 | # Copyright (C) 2015 James E. Blair <corvus@gnu.org> | ||
2 | # | ||
3 | # This program is free software: you can redistribute it and/or modify | ||
4 | # it under the terms of the GNU General Public License as published by | ||
5 | # the Free Software Foundation, either version 3 of the License, or | ||
6 | # (at your option) any later version. | ||
7 | # | ||
8 | # This program is distributed in the hope that it will be useful, | ||
9 | # but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
10 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
11 | # GNU General Public License for more details. | ||
12 | # | ||
13 | # You should have received a copy of the GNU General Public License | ||
14 | # along with this program. If not, see <http://www.gnu.org/licenses/>. | ||
15 | |||
16 | import urwid | ||
17 | |||
18 | DARK_PALETTE = { | ||
19 | '_default': urwid.AttrSpec('light gray', 'black'), | ||
20 | |||
21 | 'emphasis': urwid.AttrSpec('bold, light gray', 'black'), | ||
22 | 'title': urwid.AttrSpec('bold, white', 'black'), | ||
23 | |||
24 | 'progressive': urwid.AttrSpec('dark gray', 'black'), | ||
25 | |||
26 | # Based on pygments default colors | ||
27 | |||
28 | 'whitespace': urwid.AttrSpec('light gray', '#aaa'), | ||
29 | 'comment': urwid.AttrSpec('#688', 'black'), | ||
30 | 'comment-preproc': urwid.AttrSpec('#a80', 'black'), | ||
31 | 'keyword': urwid.AttrSpec('bold, #0f0', 'black'), | ||
32 | 'keyword-pseudo': urwid.AttrSpec('#080', 'black'), | ||
33 | 'keyword-type': urwid.AttrSpec('#a06', 'black'), | ||
34 | 'operator': urwid.AttrSpec('#666', 'black'), | ||
35 | 'operator-word': urwid.AttrSpec('bold, #a0f', 'black'), | ||
36 | 'name-builtin': urwid.AttrSpec('#0d0', 'black'), | ||
37 | 'name-function': urwid.AttrSpec('#00f', 'black'), | ||
38 | 'name-class': urwid.AttrSpec('bold, #00f', 'black'), | ||
39 | 'name-namespace': urwid.AttrSpec('bold, #00f', 'black'), | ||
40 | 'name-exception': urwid.AttrSpec('bold, #d66', 'black'), | ||
41 | 'name-variable': urwid.AttrSpec('#008', 'black'), | ||
42 | 'name-constant': urwid.AttrSpec('#800', 'black'), | ||
43 | 'name-label': urwid.AttrSpec('#aa0', 'black'), | ||
44 | 'name-entity': urwid.AttrSpec('bold, #888', 'black'), | ||
45 | 'name-attribute': urwid.AttrSpec('#880', 'black'), | ||
46 | 'name-tag': urwid.AttrSpec('bold, #080', 'black'), | ||
47 | 'name-decorator': urwid.AttrSpec('#a0f', 'black'), | ||
48 | 'string': urwid.AttrSpec('#a00', 'black'), | ||
49 | 'string-doc': urwid.AttrSpec('light gray', 'black'), | ||
50 | 'string-interpol': urwid.AttrSpec('bold, #a68', 'black'), | ||
51 | 'string-escape': urwid.AttrSpec('bold, #a60', 'black'), | ||
52 | 'string-regex': urwid.AttrSpec('#a68', 'black'), | ||
53 | 'string-symbol': urwid.AttrSpec('#008', 'black'), | ||
54 | 'string-other': urwid.AttrSpec('#080', 'black'), | ||
55 | 'number': urwid.AttrSpec('#666', 'black'), | ||
56 | 'generic-heading': urwid.AttrSpec('bold, #008', 'black'), | ||
57 | 'generic-subheading': urwid.AttrSpec('bold, #808', 'black'), | ||
58 | 'generic-deleted': urwid.AttrSpec('#a00', 'black'), | ||
59 | 'generic-inserted': urwid.AttrSpec('#0a0', 'black'), | ||
60 | 'generic-error': urwid.AttrSpec('#f00', 'black'), | ||
61 | 'generic-emph': urwid.AttrSpec('bold, #fff', 'black'), | ||
62 | 'generic-strong': urwid.AttrSpec('bold, #ddd', 'black'), | ||
63 | 'generic-prompt': urwid.AttrSpec('bold, #008', 'black'), | ||
64 | 'generic-output': urwid.AttrSpec('#888', 'black'), | ||
65 | 'generic-traceback': urwid.AttrSpec('#06d', 'black'), | ||
66 | 'error': urwid.AttrSpec('underline, #f00', 'black'), | ||
67 | } | ||
68 | |||
69 | LIGHT_PALETTE = {} | ||
70 | for k, v in DARK_PALETTE.items(): | ||
71 | LIGHT_PALETTE[k] = urwid.AttrSpec(v.foreground, 'h15') | ||
72 | |||
73 | LIGHT_PALETTE.update({ | ||
74 | '_default': urwid.AttrSpec('black', 'h15'), | ||
75 | 'emphasis': urwid.AttrSpec('bold, black', 'h15'), | ||
76 | 'title': urwid.AttrSpec('bold, #000', 'h15'), | ||
77 | 'progressive': urwid.AttrSpec('light gray', 'h15'), | ||
78 | }) | ||