1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
//! Every colour the app uses, and nothing else.
//!
//! `markdown` and `tree` describe what things *are*; `ui` decides how they look
//! and takes the values from here. Keeping them in one place is what makes the
//! colour policy checkable rather than aspirational -- see the test in `ui` that
//! walks [`ALL`].
//!
//! **Only ANSI-16 names and `Reset` belong here.** This machine's terminal is
//! configured `theme = light:"...",dark:"..."`, so it follows the macOS
//! appearance and flips *under the running app*. ANSI names are remapped by the
//! user's theme; `Indexed` and `Rgb` are fixed values that can only ever suit
//! one background. `White`/`Black` for text are effectively fixed too: an
//! earlier version rendered the task title white-on-white in light mode.
use Color;
/// Whatever the terminal's default foreground is.
pub const PLAIN: Color = Reset;
/// Secondary text: tree connectors, timestamps, the untouched part of a meter.
pub const DIM: Color = DarkGray;
/// The four task states, matching the dex CLI exactly so the two tools cannot
/// contradict each other. Taken from dex 0.16.0 `dist/cli/formatting.js`
/// (`getTaskStatusDisplay`) and `~/.local/bin/dex-report` (`glyphcolor`):
///
/// ```text
/// todo yellow 33 in progress blue 34
/// done green 32 blocked red 31
/// ```
///
/// These land on the **status glyph only**, never the task name -- which is
/// what stops a mostly-unstarted tree becoming a wall of yellow, and is what
/// dex itself does.
pub const TODO: Color = Yellow;
pub const ACTIVE: Color = Blue;
pub const DONE: Color = Green;
pub const BLOCKED: Color = Red;
/// Inline code and other literal spans in rendered markdown.
pub const CODE: Color = Cyan;
/// The selection gutter: where you are, as opposed to what anything *is*.
///
/// Magenta is the one ANSI hue carrying no meaning here -- the four states take
/// yellow, blue, green and red, and [`CODE`] takes cyan -- so a selected row can
/// never be misread as a state. A test asserts that separation.
///
/// The unfocused pane dims *within the hue* rather than falling back to [`DIM`],
/// which is exactly the colour of the `│└├` tree connectors sitting one cell to
/// the gutter's right; an unfocused cursor would disappear into them.
pub const ACCENT: Color = LightMagenta;
pub const ACCENT_DIM: Color = Magenta;
/// Every colour above, for the policy test. A colour missing from this list is
/// unguarded, so add new ones here as well.
pub const ALL: = ;