by tombh on 6/13/25, 2:04 PM with 65 comments
Firstly it solves the age-old problem of low-contrast text, like when you `ls` a broken symlink and the red background colour is too near your current theme's foreground colour. Tattoy solves this by using none other than the web's WCAG 2.1 contrast algorithm for accessible text.
Secondly, an explicit design goal is that Tattoy should be able to polyfill new terminal protocols, the `xwayland` of the TTY if you will. Say if we want to experiment with completely deprecating ANSI codes, then any application that uses a new protocol can be run in Tattoy which itself runs in any ANSI-standard terminal emulator as normal. You can read more about this idea here: https://tattoy.sh/news/an-end-to-terminal-ansi-codes/
But ultimately this has been something more akin to an art project, something to enjoy for the sheer aesthetic pleasure.
by tfsh on 6/13/25, 5:03 PM
So far it was able to take the screenshot correctly (https://ibin.co/8kaRr8TIanv2.png), however the parsing of that fails with the non-descript "Palette parsing failed." error.
Edit: enabled tracing at got this: https://paste.ee/p/ZyNxG9FK
by TheSilva on 6/13/25, 3:46 PM
https://github.com/tattoy-org/tattoy/issues/42
So, it is supported or not? Looks great by the way.
by pvg on 6/13/25, 2:06 PM
by em-bee on 6/13/25, 4:24 PM
this raises two questions: doesn't every (gui) terminal do that?
what happens if i use tmux inside tattoy?
btw: do you have examples of light themes?
by sevensor on 6/14/25, 2:04 PM
by nerflad on 6/13/25, 2:32 PM
by otterpro on 6/13/25, 3:57 PM
by msgodel on 6/13/25, 3:55 PM
I kind of like that idea.
by cenobyte on 6/13/25, 7:07 PM
by cb321 on 6/14/25, 10:14 AM
A couple of points related to contrast ratio management:
- The Mynex answer here is very informative: https://stackoverflow.com/questions/596216/formula-to-determ...
- The "limit/bound" on the contrast ratio has a "polarity" (a +- sense). At least for "text", in almost every font there are many more background pixels than foreground pixels. So, for example, your human eyes can tolerate a lower text cell fg-bg contrast with a dark background color for the text cell on an all-black background than they can for a dark foreground color on an all-black background. Part of this relates to "shared discrimination work" that the outside-the-text cell background pixels are doing. So, really "ratio" of just two things is somewhat of an oversimplification.
- XTerm OSC 4 may have a very limited ability to probe the color palette. At least on `st` I can only see default foreground, background and cursor colors, not the full 16-color palette. This mostly just amplifies the point elsethread by @hnlmorg.
- At least until more recent ssh's, default configs on Linux would pass through all "LC_*" environment variables. So, if you adjust your shell rc/configs to key off of, say, $LC_THEME having, e.g., "light" or "dark" in them, you can perhaps re-polarize everything with a much lower tech solution. I do this all the time as I like to run some terminals with a black background and some with a white background. (Paper white black & white displays were all the rage in the 90s, but these days "color hackers" seem to prefer dark backgrounds. I have theories as to why, but it's pretty off topic.) https://github.com/c-blake/lc configs have more fully fleshed out examples, and hey, you might also like that color-ls. (And I'm aware of the ancient & to my mind ugly 1980s ideas of "stuff everything into $TERM and parse it apart again". Security concerns may push us back that way.)
by grandma_tea on 6/13/25, 3:20 PM
Is there anyway for plugins to interact with shaders?
by pacifika on 6/13/25, 2:21 PM
by MatthewPhillips on 6/13/25, 4:35 PM
by ainiriand on 6/13/25, 3:53 PM
by globnomulous on 6/16/25, 12:34 PM
Seriously, this is high-quality work (as far as I can tell -- though it is way outside of my area of expertise) and the presentation is a model of class and taste. This is what I come to HN for, and it's a badly needed shot of motivation to start, finally, working on my own terminal-related project.
by gfalcao on 6/13/25, 5:49 PM
by djaychela on 6/13/25, 6:12 PM
by ramon156 on 6/13/25, 3:21 PM
by hnlmorg on 6/13/25, 9:13 PM
That’s already a solved problem. You use a terminal theme that produces high contrast against all the 16 terminal colours.
Plenty of good themes exist.
The bigger problem, in my opinion, is software that uses 8 bit or 16 bit colour ANSI codes and thus overrides your terminals theme. Personally I consider this rude behaviour but I know there is a subset of HN that disagrees with me here.
by PeterStuer on 6/14/25, 5:38 AM