Coverage for src/hods/tui/palette.py: 100.00%
Shortcuts on this page
r m x p toggle line displays
j k next/prev highlighted chunk
0 (zero) top of page
1 (one) first highlighted chunk
Shortcuts on this page
r m x p toggle line displays
j k next/prev highlighted chunk
0 (zero) top of page
1 (one) first highlighted chunk
1"""hods - home directory synchronization.
3Copyright (C) 2016-2020 Mathias Stelzer <knoppo@rolln.de>
5hods is free software: you can redistribute it and/or modify
6it under the terms of the GNU General Public License as published by
7the Free Software Foundation, either version 3 of the License, or
8(at your option) any later version.
10hods is distributed in the hope that it will be useful,
11but WITHOUT ANY WARRANTY; without even the implied warranty of
12MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13GNU General Public License for more details.
15You should have received a copy of the GNU General Public License
16along with this program. If not, see <http://www.gnu.org/licenses/>.
19Global color palette for hods.
21Check docstrings in `urwid.display_common.BaseScreen` for usage:
22>>> from urwid.display_common import BaseScreen
23>>> BaseScreen.register_palette_entry
24"""
26# name: ('fg-16', 'bg-16/8', 'mono', 'fg-256', 'bg-256') # noqa: E800
27palette_dict = {
29 # general
31 'frame': ('black', 'light gray'),
32 'frame header': ('dark cyan', 'light gray'),
34 'menu': 'frame',
35 'menu focus': ('white', 'dark cyan'),
36 'menu select': 'menu focus',
37 'menu window': 'frame',
39 'body': ('white', 'black'),
40 'body focus': ('white', 'black'),
42 'edit': 'body',
43 'edit focus': ('white', 'dark cyan'),
45 'button': ('light cyan', 'black'),
46 'button focus': ('white', 'dark cyan'),
48 'success': ('light green', 'black'),
49 'success focus': ('white', 'dark green'),
50 'success window': 'success focus',
52 'warning': ('yellow', 'black'),
53 'warning focus': ('white', 'brown'),
54 'warning window': 'warning focus',
56 'error': ('light red', 'black'),
57 'error focus': ('white', 'dark red'),
58 'error select': 'error focus',
59 'error window': 'error focus',
61 'disabled': ('dark gray', 'black'),
62 'disabled focus': ('dark gray', 'light gray'),
63 'disabled select': 'disabled focus',
65 # config tree
67 'feature': ('light green', 'black'),
68 'feature focus': ('white', 'dark cyan'),
69 'feature select': ('white', 'dark green'),
70 'feature window': 'feature select',
72 'source': ('light magenta', 'black'),
73 'source focus': ('white', 'dark cyan'),
74 'source select': ('white', 'dark magenta'),
75 'source window': 'source select',
77 'directory': ('light blue', 'black'),
78 'directory focus': ('white', 'dark blue'),
79 'directory window': 'directory focus',
81 'file': ('white', 'black'),
82 'file focus': ('black', 'light gray'),
83 'file window': 'file focus',
85 'symlink': ('light cyan', 'black'),
86 'symlink focus': ('black', 'dark cyan'),
88 'template': 'file',
89 'template focus': 'file focus',
90}
92PALETTE = []
93for key, colors in palette_dict.items():
94 if not isinstance(colors, tuple):
95 colors = palette_dict[colors]
96 PALETTE.append((key, *colors))