You generally want to stick to default colors because of terminal color
schemes. If you don't, you risk getting suboptimal contrast and
difficult-to-read text. When you _do_ want to peg something to a color,
you need to fully specify the foreground and background to ensure you
have enough contrast for text to be readable.
Our project, below
(https://github.com/facebookincubator/resctl/tree/master/resctl/below),
wants to set a less jarring highlight color than red. In order to
effectively do this, we need a way to specify the highlighted text color
without causing a cascade of pegged colors. In other words, if we were
to manually set PaletteColor::View, we would need to manually set
everything PaletteColor::View is `ColorStyle`'d with, and so forth.
I realize this is an API breaking change. I spent some time considering
alternatives (such as detecting whether or not `HighlightText` is set,
and if not, use `View` as the highlighted text color). The problem with
the other options is that you'd need to:
1) Document the fallback behavior
2) Maintain backwards compat code paths
Seeing as cursive is pre-1.0 release, I figure this is the best way
forward.
This change fixes cursive issue #428, caused by indexing into an empty
list. The issue is corrected by using the .get() method to safely
handle the case where the requested index doesn't exist, and renders
no label in that case.
Change the tertiary color in the default theme to white instead of grey.
Currently, the tertiary color is the same as the view background color,
making it invisible as foreground color. This makes the Outset effect
not work as (I think) intended.
NoBold (21) doesn't work in many terminals
22 (named NormalIntensity in crossterm, and NoFaint in termion) seems to do a better job.
Attempt at fixing #401.
Something is wrong at the moment when finishing up, when
the crossterm backend is used.
The terminal is left in a strange state: the previous contents of the
terminal (as before the program) are visible, however the cursor is
invisible (and reset to the top left), and clicking the mouse spams
escape codes.
For some reason the `execute!` block in `finish` is failing. But it
doesn't seem to be necessary: crossterm already restores the alternative
screen at shutdown, which also restores the original cursor position and
attributes.
Do make sure that mouse mode is stopped and that the cursor is visible.