| ▲ | seanwilson 8 hours ago | |||||||||||||||||||||||||
If the goal of the post is to pick terminal colors that contrast on both white/light and black/dark backgrounds, it means you're stuck with midtone colors (between light and dark). This is really limiting for color choice (there's no such thing as "dark yellow" for example), and lowers the maximum contrast you can have for text because you get the best contrast when one color is dark and the other is light. Ideally, instead of the CLI app switching to "bright green", it would pick a "bright contrasting green". So if the terminal background was dark, it would pick bright green, and for light background it would pick a darker green. There isn't CLI app implementations for this? This is similar to how you'd implement dark mode in a web app. | ||||||||||||||||||||||||||
| ▲ | account42 8 hours ago | parent | next [-] | |||||||||||||||||||||||||
> Ideally, instead of the CLI app switching to "bright green", it would pick a "bright contrasting green". So if the terminal background was dark, it would pick bright green, and for light background it would pick a darker green. There isn't CLI app implementations for this? This is similar to how you'd implement dark mode in a web app. The responsibility for this lies with the color scheme not the terminal program. | ||||||||||||||||||||||||||
| ▲ | JoshTriplett 8 hours ago | parent | prev | next [-] | |||||||||||||||||||||||||
CLI apps can detect the background color of the terminal, and determine contrasting colors accordingly. | ||||||||||||||||||||||||||
| ||||||||||||||||||||||||||
| ▲ | alt187 8 hours ago | parent | prev [-] | |||||||||||||||||||||||||
That's called `\e[0;92m`, aka the ANSI terminal espace sequence for bright green. You have 15 others, that will be displayed however the terminal's user wants. They're already available in most terminal color libraries, too. | ||||||||||||||||||||||||||