kevincobain2000/gobrew

Hard to read output in light scheme colors

Closed this issue · 4 comments

Zerpet commented

Description

When the system color scheme is set to light, the output of gobrew is hard to read because it outputs in yellow font color. This is on a M1 Mac, but I think it will be a problem for Linux users as well. See the below screenshot:

Screenshot 2023-05-09 at 09 25 16

Possible solutions

We could try to change the color output based on system color scheme. I haven't researched how to do this in Go, but I hope this is a solved problem across different platforms 🙂

Another solution would be to make the color output configurable.

I'm happy to contribute a PR.

That should be easy fix. Thanks for reporting.

juev commented

Another solution would be to make the color output configurable.

Maybe we can use new flag, for example nocolor?
Or use nocolor as default, and add color flag for output with colors?

I like this idea.

I think we can simply check the term color via termenv as output.HasDarkBackground() and set colors according to that

gobrew/utils/utils.go

Lines 14 to 18 in d1918ff

var ColorMajorVersion = color.New(color.FgHiYellow)
var ColorSuccess = color.New(color.FgHiGreen)
var ColorInfo = color.New(color.FgHiYellow)
var ColorError = color.New(color.FgHiRed)

How about this?
#103