42 comments

[ 4.7 ms ] story [ 64.4 ms ] thread
> Complex and color-heavy programs struggle with such a small palette.

Damn if only there was some other system that could be operating with that in mind

Yeah, when you point it out, this makes complete sense and every terminal should probably add this feature. I think I would generalize this to 24-bit color as well; 16 colors isn't enough to identify a unique tonemap, but if you fiddle with the parameters a bit I think it shouldn't be too hard to come up with something hacky that works.

Although, this should probably be optional (both as an option for terminals to have in their own settings, and via an escape sequence that opts out), because some users will have configured some programs with a color scheme that they don't want transformed. For example, if your terminal uses the Solarized color scheme, and your text editor _also_ uses the Solarized color scheme, then this could lead to double-applying a color transform and getting something odd.

This definitely seems like a sensible starting option to generate 256 colours from a custom set of 8 (and then let the really pedantic users fiddle with the extended set). I would presume for "standard" themes these values would be pregenerated and adjusted slightly if needed.
The good thing with the 256c palette is that colors in the 16-255 range are fixed, which gives us a very high level of confidence that 146 will be a muted violet and so on. This is very useful for colorscheme developers because it allows us to provide a pretty good and consistent experience across the widest range of terminal emulators.

If the 256c palette is generated from a -- potentially wild -- 16c palette then there is no guarantee anymore that 146 will indeed be the 146 I expect.

Turning 16-255 into the same kind of minefield as 0-15 seems very misguided to me.

> This is very useful for colorscheme developers

I would posit then that this article simply doesn't apply to you at all. The feature being described is targetted at users who are effectively developing their own schemes (albeit in a rather simplified automated manner). If I'm taking something off the shelf, I'm using the appropriate recommended base16. I have no expectation that a wild base16 is going to align with any 3rd-party's curated scheme.

I do understand that this logic isn't always going to click with people given the differing contexts of a terminal-wide -vs- app-specific (i.e. vim) approach, but again: that disparity seems either a legacy issue (caused by things like this 16-256 mis-alignment) OR simply a philosophical difference (whereby people who customise at the term level shouldn't at the app level & vice-versa).

Agree, and I love how concise, yet persuasive and practical this proposal is.
(comment deleted)
It's perennially baffling to me why we're still clinging to VT220/xterm compatible terminals. I even see people claiming they prefer working in the terminal, though it's not clear to me what type of work those people are doing.

Give me a proper graphical application any day, but I recognize that it's historically been a lot more work to produce a GUI in the pre-LLM era.

But golly gee whizz if we're going to keep the command line around, can we move on from 1983?

I'm not sure I understand - if you could have your way everything would be a GUI and no CLI? Or just terminals in their current form are not good?
What I would like is HDR colors, just to access more saturated light colors. I don't want less saturated blue to make it lighter, just crank up the blue channel to 11. I still don't want brighter colors than #fff though.
If any end users actually cared about terminal/TUI apps, there would be modern APIs for whatever they want.

Since this is really just a legacy system operator monk / retrocool interface, they spend years debating ancient DEC theology.

Terminals should not exist, emulating a serial teletype emulating a Hollerith machine
This is a limitation of UNIX terminals, in other platforms not tied to a no longer existing tty interface, this isn't an issue.

Unfortunely, given that we are stuck with UNIX derived OSes, this is indeed a possible issue.

However I would argue, for fancy stuff there is the GUI right there.

Terminals should be able to show images, so you could run Jupyter notebooks in them.
I’d also add a quantization slider that would quantize the in-between colors to less than 256 different colors; in the extreme position to just the 16 colors.
That would be a super-niche setting, but an interesting idea nonetheless.
Kde has their own palette, and I hate it, the colours are all wrong, and the scheme is fugly... I usually set it to "Linux default" and hope its good enough to read
I had exactly this thought!

Though, I have a problem with even just the basic 16 colours:

black red green yellow blue magenta cyan white bright black bright red bright green bright yellow bright blue bright magenta bright cyan bright white

~~~

Many themes take `black` to mean `black` and `white` to mean `white`. How is it supposed to work when one switches the theme between the dark and the light version?

What are `black`, `white`, `bright black`, and `bright white` supposed mean?

I take those as meaning (in order): `almost invisible on current terminal background`, `pretty contrasty`, `visible but not contrasty`, and `the contrastiest`.

I wish the colour names reflected that, instead of `black` and `white`: you usually care about the contrast, not about the precise colour.

Really interested in this for cargo/rustc. We run into issues where we need one or two more colors but all that is left after going for the basic semantic colors is magenta (odd choice), and black and white (not safe without inspecting the theme).
Just use direct color mode (24bit, "true color")[1] and there will be no need for a palette.

> Fewer terminals support truecolor.

From what I know all modern terminal emulators in all operating systems support it now.

[1] https://github.com/termstandard/colors

> From what I know all modern terminal emulators in all operating systems support it now.

urxvt prominently doesn't (fully)

Color schemes voluntarily added by the user to an app like vim, great.

All the more reason for developers to keep the app itself responsive to the user’s environment by default.

Don’t bake in elaborate visual choices. It’s a usability thing first and a style thing somewhere much farther down the list.

Keep it simple from the factory. Don’t get in the way of customization. Let the user’s environment do the work of adapting it to the user.

This new palette should be behind a new control code, that should sort out the issue of opting in.
My streaming markdown renderer does something like that https://github.com/day50-dev/Streamdown

You define a baseline color in HSV and then everything else is a multiplier of that

For example

[style]

HSV = [0.7, 0.5, 0.5]

Dark = { H = 1.0, S = 1.2, V = 0.25 } # Make dark elements less saturated and darker

Symbol = { H = 1.0, S = 1.8, V = 1.8 } # Make symbols more vibrant

As a result you can simply move around the HSV to your preference in the config and things don't look like garbage where you have to hand tweak every color to get something legible.

For example, this simple loop https://github.com/day50-dev/Streamdown?tab=readme-ov-file#c...

It's effectively a swatch

Oddly enough, I'm colorblind and I have had the worst time with color schemes. Many are completely unreadable and lack sufficient contrast. Others I just don't like

So, I've started using AI models to generate color schemes for me.

Take an unreadable theme I like and generate one that is high contrast and still coherent. It's probably not good enough for a full spectrum vision person to use but wow has it improved my quality of life.

It wouldn't surprise me if this is exactly the type of problem that is solved in the same way for the rest of you

> Many are completely unreadable and lack sufficient contrast.

I am not colorblind, and have the same experience. It's made worse by the fact that different apps use colors differently, so if I find a theme that works well for some clis and tuis, there will be others that will have unreadably low contrast with the default theme. So I have to tweak the colorscheme for each application as well.