22 ms·
These issues are precisely why Textual uses Truecolor by default. It is supported on the vast majority of terminals. Colors are reduced to 256 (actually 240 bec
by willm 4y ago
These issues are precisely why Textual uses Truecolor by default. It is supported on the vast majority of terminals. Colors are reduced to 256 (actually 240 because we avoid the ANSI colors) on terminals without truecolor support.
16.7 million colors gives you a lot more control over emphasis, and de-emphasis. You can fade foreground / background, you can draw subtle borders, and you can boost saturation. Many of the techniques that web-developers have enjoyed for years.
It's true we don't make use of the user's theme, but you've laid bare the problems with ANSI themes. Respecting the user's color theme isn't going to guarantee readability (probably the opposite).
- chrismorgan 4y agoI think that for most apps, this is the wrong approach to use by default, as it will produce something that will always look out of place. I think you’re generally better to default to just using the five or so dependable colours, and not try to be cleverer. You may be able to mitigate the damage by checking what the default background and foreground colours are (and perhaps other of the top 16 colours, to get a feel for the style of theme) and choosing colours that will match as closely as possible while still supporting the flexibility you want, but that would be a fair bit of work to do well. Terminals are not the web. As an extensive user of both terminal and web, and often a heavy customiser of both, I would strongly prefer that by default you prefer to fit in, even though it limits your degree of expression.