Skip to content

Bright terminal readability#457

Merged
MichaelMure merged 2 commits intogit-bug:masterfrom
zdenek-crha:bright_terminal_readability
Sep 27, 2020
Merged

Bright terminal readability#457
MichaelMure merged 2 commits intogit-bug:masterfrom
zdenek-crha:bright_terminal_readability

Conversation

@zdenek-crha
Copy link
Copy Markdown
Contributor

Fixes to the color rendering that is hard or impossible to read in bright terminals. Should make issues mentioned in #453 bit more bearable, but does not solve it completely.

Change rendering of background color that might clash with default foreground to use both foreground and background color specification to avoid rendering hard to read (black on blue) or impossible to read (black on black) text.

I'm not entirely sure about GreyBold color alias changes in second commit. Due to its name being inconsistent with config (see commit message) I have no idea what was the intended style. I went with bold black fg on white bg, but feel free to point me to different scheme.

Copy link
Copy Markdown
Contributor

@MichaelMure MichaelMure left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It seems to be the way to go, just one small thing to fix.

Comment thread termui/help_bar.go Outdated
Comment thread util/colors/colors.go
@zdenek-crha
Copy link
Copy Markdown
Contributor Author

@MichaelMure Added fix to review comment as separate commit (I would usually amend, but seen you reply only after I pushed separate commit. Feel free to squash it)

Comment thread commands/show.go Outdated

if comment.Message == "" {
message = colors.GreyBold("No description provided.")
message = colors.BlackBold(colors.White("No description provided."))
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm a bit confused, you are setting the foreground color twice. Shouldn't that be one for the bg, one for the fg ?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@MichaelMure Good catch, it should be WhiteBg instead of White. I've fixed it and took the opportunity to squash all review fixes to relevant commits.

Set both background and foreground color when displaying help bar to
avoid sitation where default foreground color used by terminal is hard
to read on blue background (like cyan on blue or black on blue).

Apply colors to whole generated help bar to avoid 'stripes' of different
background color where whitespace is used between help items.
The rendering of color for 'No description provided' text is broken on
bright terminals - it sets black background which together with default
black forground color renders opaque rectangle.

The GreyBold color alias is broken too - name suggests bold gray
forground color, but actually sets bold default fg color with black
bacground.

First make color alias consistent. Rename it to BlackBold and have it
set bold black fg color (same as similar *Bold aliases).

Second, update all places which use it to render text to also use white
background to prevent it from disappering in terminals with black
background color.
@zdenek-crha zdenek-crha force-pushed the bright_terminal_readability branch from 5742de4 to 999e612 Compare September 27, 2020 07:25
@MichaelMure
Copy link
Copy Markdown
Contributor

Awesome, thanks!

@MichaelMure MichaelMure merged commit ae0529e into git-bug:master Sep 27, 2020
@zdenek-crha zdenek-crha deleted the bright_terminal_readability branch September 27, 2020 12:48
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants