tui-rs
tui-rs copied to clipboard
Color::Gray is rendered as Color::White
Describe the bug
When you style a Span
with .fg(Color::Gray)
or .bg(Color::Gray)
it renders the Span
as if Color::White
was provided. It looks like the code just uses Color::White
, which was unexpected to me: https://github.com/fdehau/tui-rs/blob/master/src/backend/termion.rs#L156, https://github.com/fdehau/tui-rs/blob/master/src/backend/termion.rs#L182.
To Reproduce
Create a paragraph with a styled Span
with Color::Gray
, something like:
Spans::from(Span::styled(
"hello world",
Style::default().fg(Color::Gray),
)),
Expected behavior It renders something that is gray.
You missed a section of the bug report template and it would be useful to understand the problem here. Could you report the following values: OS: [e.g. Linux,Windows] Terminal Emulator [e.g xterm, Konsole, Terminal, iTerm2, ConEmu] Font [e.g Inconsolata, Monospace] Crate version [e.g. 0.7] Backend [e.g termion, crossterm]
In addition, I just added a third tab to the demo that might help us debug your issue: #439. It would be nice if you can run on master:
cargo run --example termion_demo
navigate to the third tab and add a screenshot of what you are seeing. For example, here's mine:
Gotcha, I omitted it because I thought the bug was as simple as the code incorrectly using White
instead of Gray
(when rendering Gray
), but I see now that it renders LightWhite
when rendering White
.
OS: MacOS Catalina 10.15.7 Terminal Emulator: iTerm2 (3.4.3) Font: Menlo Crate version: 0.10 (also on latest master) Backend: termion
Here's what I see on the third tab for the example (for me, gray looks the same as white):
I believe I'm using the iTerm2 snazzy color scheme: https://github.com/sindresorhus/iterm2-snazzy.