WIP: rename default theme to light, rework light+dark themes with consistent colors #2175
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This is Work In Progress, it will take me some time to write up properly what's done and why, and what the caveats are -- but I wanted to raise this now before the branch gets too stale.
Rename the default theme to "light" and rework both it and the dark theme in terms of colours picked from the "fixed" 240-color palette. This should result in consistent colours between terminal emulators, with some caveats
A drawback of doing this is that the colours will not display at all in terminals which don't support the 240 palette. I think that it's extremely uncommon for modern users to have a Terminal that doesn't support these; but more common would be having a misconfigured terminal (or some intermediary software: ssh, tmux, screen, etc. introducing a problem). This can be simulated by overriding
TERM
, e.g. withTERM=xterm-color
(where xterm-color is a terminfo definition which doesn't support the 240 color palette).To make this failure mode less catastrophic, many of the "selected" lines have
reverseVideo
set, and also the fg/bg colors swapped, which should look like a no-op when the color is supported, but is visible as reversevideo when the color is not supported. This means it can still be used. Example:However, using this reverseVideo hack appears to introduce an unfortunate artifact in the right-hand border of selected lines when color is working:
I'm not sure yet whether this is a bug in this patch/hledger-ui, brick or vty. (The dark theme isn't affected)
Some TODOs