5 ms·
Color output seems to be tuned for dark terminal backgrounds. Memory, vCPUs, and Storage are nearly unreadable on a white background.
by solatic 6y ago
Color output seems to be tuned for dark terminal backgrounds. Memory, vCPUs, and Storage are nearly unreadable on a white background.
- hnlmorg 6y agoI've moaned about this with other CLI tools as well. I wish trend of using RGB values in ANSI escape codes would die because as ugly as the 16*3 colour fields¹ are, they are at least customisable so people can use palettes that suite their terminal and eyesight. You don't get any such opportunity if the developers hard code the colour values in (and it's worse with a tool like this because you can't even set an environmental variable to change the tools behaviour) ¹ sixteen colours plus bright and dark variants
- ASVVVAD 6y agoCan you link me to a way to use colours that change with the terminal colour preset? I haven't come across anything like that or maybe didn't pay attention. It would be really helpful You said you can't even set an env variable to change them so I assume that there is an even better way?
- hnlmorg 6y agoWikipedia has a good section on the different methods of describing colour: https://en.wikipedia.org/wiki/ANSI_escape_code#3/4_bit https://en.wikipedia.org/wiki/ANSI_escape_code#3/4_bit I've got some Go code that you can reuse if you want to the escape codes in Go: https://github.com/lmorg/murex/blob/master/utils/ansi/codes.go https://github.com/lmorg/murex/blob/master/utils/ansi/codes.... Just bare in mind that any numbers you see in documentation are sent as ASCII values rather than integers. eg `ESC[31m` (red text) should be sent to the terminal as []byte{ // http://www.asciitable.com/ 27, // ESC character code 91, // '[' 51, // '3' 49, // '1' 109, // 'm' } Though, as you know, most languages will have some syntactic sugar to translate characters to their ASCII values, eg 'm' == 109 Asc("m") == 109 ...etc... so at least you don't have to write all those values by hand.
- ASVVVAD 6y agoThanks for the explanation and the snippets ^^
- kristopolous 6y agoOn Linux, in X, you can use xresources. Otherwise there's termcap
- ASVVVAD 6y agototally forgot about xresources! thanks for the reminder
- allis10 6y agoSounds like you played a stupid game and won a stupid prize.
- dang 6y agoCould you please read and follow the site guidelines? https://news.ycombinator.com/newsguidelines.html https://news.ycombinator.com/newsguidelines.html We're hoping to have a different sort of discussion than internet default here.
- numlock86 6y agoThanks for the heads up. Colored output in terminal programs is a no go.
- kolinkorr839 6y agoI have a white background too. Is there a workaround for this?
- kureikain 6y agoI disable the colorize so it should be your default terminal now.