Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Hard to read default color scheme #275

Open
dveeden opened this issue Jan 13, 2022 · 3 comments
Open

Hard to read default color scheme #275

dveeden opened this issue Jan 13, 2022 · 3 comments
Assignees

Comments

@dveeden
Copy link
Contributor

dveeden commented Jan 13, 2022

Bug Report

On CentOS 7 with the default terminal configuration the light-yellow on white as seen here is hard to read:

image

What version of Diag are you using (tiup diag --version)?

$ tiup diag --version
Starting component `diag`: /home/dvaneeden/.tiup/components/diag/v0.5.1/diag --version
tiup diag v0.5.1 @master (53c4a871483dd8ff144b8fd18f812fe1cbbc86fe)
@AstroProfundis
Copy link
Contributor

The UI was not adjusted for light color consoles, how would you think if we add a dark background for those light colored chars?

@dveeden
Copy link
Contributor Author

dveeden commented Jan 18, 2022

package main

import (
	"bufio"
	"fmt"
	"os"

	"golang.org/x/crypto/ssh/terminal"
)

func main() {
	reader := bufio.NewReader(os.Stdin)
	s, _ := terminal.MakeRaw(int(os.Stdin.Fd()))
	fmt.Printf("\x1b]11;?\a")
	c := make([]byte, 23)
	reader.Read(c)
	terminal.Restore(int(os.Stdin.Fd()), s)
	fmt.Printf("Terminal Color: %s\n", c[5:])
}

This results in:

Black background:

$ ./bgcolor 
Terminal Color: rgb:0000/0000/0000

White background:

$ ./bgcolor 
Terminal Color: rgb:ffff/ffff/ffff

Yellow background:

$ ./bgcolor 
Terminal Color: rgb:ffff/ffff/dddd

We can use this to either select more appropriate colors or to set color.NoColor = true.

@dveeden
Copy link
Contributor Author

dveeden commented Jan 18, 2022

The UI was not adjusted for light color consoles, how would you think if we add a dark background for those light colored chars?

That might move the problem as dark colors on a dark background might not be very readable as well. I think we should choose the right colors depending on the background color.

However a slightly darker color might work well enough on both white and black backgrounds.

@qqqdan qqqdan self-assigned this Feb 28, 2022
@qqqdan qqqdan added this to the Beta -1 v0.7.0 milestone Feb 28, 2022
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

No branches or pull requests

3 participants