Live data from Hacker News

Terminals should generate the 256-color palette

gist.github.com

81–90 of 212 posts

Re: Terminals should generate the 256-color palette

#81
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

Re: Terminals should generate the 256-color palette

#82
post #48

Earlier quoted context omitted.

> provide a [...] consistent experience Please just don't. This is not the web. Color usage in the terminal should be largely semantic, not stylistic. Speaking for the group of people I know and work with, we don't want a "consistent experience" and hate TUIs that try to manhandle the color palette. Use color sparingly and with intention. Respect that different people have different settings.

First, I make third-party Vim colorschemes, not app. People install my colorschemes because they like the colors, not because I'm a monster with a gun pointed at their face. No one is harmed. No one is forced to do anything they don't want. Outside of my text editor, where colors matter a lot to me for syntax highlighting, I'm definitely in the NO_COLORS camp (and in the NO_EMOJI camp, nowadays). > Color usage in the…

Can you link to your Vim colorschemes? I have a light and a dark one that I hacked over the years but I'm always looking for new ones.

Re: Terminals should generate the 256-color palette

#83
post #74

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

Doesn't work. You don't have full control over every color all the time and you're going to make assumptions. That's kinda the point.

Re: Terminals should generate the 256-color palette

#84
post #49
post #40

Earlier quoted context omitted.

> it's not clear to me what type of work those people are doing. As little as possible. Anything that can be done in a terminal can be scripted and automated, put under version control, and deployed using modern CI/CD and devops tools.

> Anything that can be done in a terminal can be scripted and automated Sure, next time I'll need to quickly edit a configuration file I'll setup a complete CI/CD pipeline to run vim (or nano, or whatever) inside it.

Calm down, they wrote "can", not "should".

Re: Terminals should generate the 256-color palette

#85
post #74

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

The entire point is to not use true colour but rather a user-configurable theme, but with 256 colours.

Re: Terminals should generate the 256-color palette

#86
post #48

Earlier quoted context omitted.

> provide a [...] consistent experience Please just don't. This is not the web. Color usage in the terminal should be largely semantic, not stylistic. Speaking for the group of people I know and work with, we don't want a "consistent experience" and hate TUIs that try to manhandle the color palette. Use color sparingly and with intention. Respect that different people have different settings.

First, I make third-party Vim colorschemes, not app. People install my colorschemes because they like the colors, not because I'm a monster with a gun pointed at their face. No one is harmed. No one is forced to do anything they don't want. Outside of my text editor, where colors matter a lot to me for syntax highlighting, I'm definitely in the NO_COLORS camp (and in the NO_EMOJI camp, nowadays). > Color usage in the…

It would be much better if application developers (and web developers, too) -only- had access to semantic color labels like TEXT, BACKGROUND, ERROR, WARNING, INFO, HIGHLIGHT, and so on, rather than red, yellow, blue, green, black.

I don’t want my applications to decide “this element must be red text on green background.” I want my applications to annotate the UI with things like “warning message” and “title.”

Re: Terminals should generate the 256-color palette

#87

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 t…

I'm sorry, but I find this mentality from app developers extremely annoying. I personally prefer light themes everywhere, both in IDEs and in the terminal. I thought that just choosing my own color scheme for 0-15 would give me the color pallette that I prefer, but because app developers like you for some reason decided that you know better what colors do I prefer, this is actually not enough. I also have to configur…

+1

We use an ansible task to ensure SYSTEMD_COLORS=16 is in /etc/environment on every system and it at least solves that problem...

Re: Terminals should generate the 256-color palette

#88

Earlier quoted context omitted.

First, I make third-party Vim colorschemes, not app. People install my colorschemes because they like the colors, not because I'm a monster with a gun pointed at their face. No one is harmed. No one is forced to do anything they don't want. Outside of my text editor, where colors matter a lot to me for syntax highlighting, I'm definitely in the NO_COLORS camp (and in the NO_EMOJI camp, nowadays). > Color usage in the…

It would be much better if application developers (and web developers, too) -only- had access to semantic color labels like TEXT, BACKGROUND, ERROR, WARNING, INFO, HIGHLIGHT, and so on, rather than red, yellow, blue, green, black. I don’t want my applications to decide “this element must be red text on green background.” I want my applications to annotate the UI with things like “warning message” and “title.”

I would really love to have that, too, on every "platform" I have to work on.

Re: Terminals should generate the 256-color palette

#89
post #57

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 `b…

Unless you provide a way to configure the colors, it’s better to simply rely on bold, reverse, and standout. If you using the 16p, don’t use black and white unless you know ehat the background is, and use the others sparingly and semantically (no rainbow soup). If you’re going for 256p, it should be in a theme engine that’s user configurable.

Re: Terminals should generate the 256-color palette

#90
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

Post reply on HN