There are many themes, but this one is yours
24 points by mitsuhiko
24 points by mitsuhiko
Disclaimer here: this is from our company blog and it abstractly relates to a coding agent but it really doesn’t have anything to do with AI.
Interestingly what I learned from this is that there is no good contrast algorithm available today so we are trying to get people to do the survey so that we can get some good real world data points to get an open source algorithm for the contrast that is freely usable by anyone.
Survey is here if you are willing to take it: https://contrastsurvey.earendil.com/
Some of these are just very confusing, I feel like halfway through I started to question what it even meant for one of the blocks to stand out.
I'm hopeful you guys will publish the results in a great blog post, now I'm invested in learning more about your findings.
PS: What theme do you use?
Some of these are just very confusing, I feel like halfway through I started to question what it even meant for one of the blocks to stand out.
Yap, I know it's a bit lengthy but I'm not sure it can be done much shorter. We'll learn something from it! I did som early tests on the survey and they confirmed a certain notorious algorithm performed much better than others, so I think we are getting some data here.
PS: What theme do you use?
I'm using the Pi system theme and have it adapt to my Ghostty themes which are "Ayu Light" during the day and "rapture" at night.
I think that survey is too long. It says "about 60 taps", but I did a fair bit before getting to a section with 50 rounds of squares and words, which felt like a lot already, and then it went on to 8 rounds of animated/swapping squares, and that's where I threw in the towel.
[edit] Oh, I see you addressed that in the sibling comment.
Pi has around 60 color roles, from body text and dim text to panels behind tool calls and red text on a red error panel.
Perhaps I'm going to sound like a curmudgeon, but imho this is the problem that should be getting addressed, not figuring out how to eke out a few more readable contrast combinations.
The recentish trend to making every new tool spew its own custom blend of unicorn puke has me about ready to resign myself to setting a global NO_COLOR once and for all.
How would you address it?
I don't have enough recent experience with pi to really offer a specific critique, so this will be somewhat general (and more than somewhat opinionated.)
First off, to the original point... color (or other emphasis) should be used as a callout to highlight the most important things. When everything is important, nothing is. I struggle to comprehend how I could conceivably gain value by having up to 60 different color coded elements on my screen. That's just too much to be memorized or fit any intuitive framework. I'd lose track of what they mean far before 60, and just start tuning them all out. (not to mention that 'roles' like "red on red" border on nonsensical.) Maybe you have 60 different semantic roles that are valid, but it seems like the default for the vast majority should be no custom color as it's not adding anything. Let the user go all Pollock on it, if they must, with custom config.
Some other miscellaneous points wrt TUIs:
I struggle to comprehend how I could conceivably gain value by having up to 60 different color coded elements on my screen
You don't. That's how how this system works at all. You can run Pi yourself and you will discover that Pi is very conservative when it comes to colors.
For many months, Pi annoyingly insisted on a light/dark theme duo, with no option at all to disable the machinery that sets its own colors. Thankfully there was https://github.com/mavam/pi-terminal-theme.
But I can’t help but feel that this is needlessly complex. Typically a terminal application with a "native" palette maps its colors to terminal colors in a best effort manner. But I understand that it’s quite awkward to map a set of 60 elements to a set of 18 elements.
I believe that the contrast problem is better solved on the terminal emulator’s end. kitty has text_fg_override_threshold, Ghostty has minimum-contrast and iTerm2 has a minimum contrast setting as well. This detail is frustratingly missing from the discussion around Pi’s system theme design. I commend the enthusiasm of the survey but it’s important to be aware that some terminals will rewrite your colors anyway.
As a concrete example, the base16_transparent theme in Helix is horrendous with most kitty themes I’ve tried. But a sufficiently high minimum contrast setting made it good enough. Incidentally, here Helix demands 76 colors, which sits uncomfortably close to Pi’s stated number despite the fact that Helix has a much less trivial UI.
I don’t want every terminal application to be doing its own contrast calculations; I cannot rely on them doing so, thus I will set minimum contrast anyway so I don’t have to think about it.
Perhaps there should be a protocol that allows a terminal application to ask for contrast adjustments when it knows it’s using entirely too many colors and needs help.
For many months, Pi annoyingly insisted on a light/dark theme duo
I'm confused you say that because Pi did not. You can set a basic theme.
Yes there was pi-terminal-thème for instance, which I have been using until the system theme was added. I should have said that the built-in themes were only dark/light, and that the issue of "fitting the terminal colors" was initially only remedied by an automatic switching between the two, before the system theme was added. I was referring to the out-of-the-box experience, which is how I used Pi really. The only extension I ever had was pi-terminal-theme.
This is great stuff. I saw some notes on contrast differences in existing light+dark themes, but one thing to consider is that (IMO) contrast matters more in dark themes - that is, you need higher contrast bump for same readability compared to a light theme (visual).
I have support for oklch in my emacs color library, but haven't given it a go, I got sniped by the more recent hct colorspace (google material thing?).
I recall issues when working in hsluv (the gamut was smooshed enough that everything came out looking muted from the S), maybe okhsl fixes some of that.
Anyway this kind of dynamic contrast nudging is sick, long have programmers been plagued by tweaking one color and then realizing you might have to change /all/ your colors while down the rabbithole.