Posted on February 9, 2017 with tags opensource.
A while back I was looking for some information on the web, and happened upon a blog post about the subject. I don’t remember what I was looking for, but on the same blog, there was a screen shot of what I then learned was the Solarized theme. This caught my eye that I decided to try it myself ASAP.
Up until last year, I’ve been using for many years the ‘black on light yellow’ xterm scheme. This is good during the day, but too strong during night, so on some machines I switched to ‘white on black’, but this was not entirely satisfying.
The solarized theme promises to have consistent colours over both light and dark background, which would help to make my setups finally consistent, and extends to a number of programs. Amongst these, there are themes for mutt on both light and dark backgrounds using only 16 colours. This was good, as my current hand-built theme is based on 256 colours, and this doesn’t work well in the Linux console.
So I tried changing my terminal to the custom colours, played with it for about 10 minutes, then decided that its contrast is too low, bordering on unreadable. I switch to another desktop where I still had open an xterm using white-on-black, and—this being at night—my eyes immediately go ‘no no no too high contrast’. In about ten minutes I got so used to it that the old theme was really really uncomfortable. There was no turning back now ☺
Interestingly, the light theme was not that much better than black-on-light-yellow, as that theme is already pretty well behaved. But I still migrated for consistency.
Starting from the home page and the internet, I found resources for:
- Vim and Emacs (for which I use the debian package
- Midnight Commander, for which I currently use peel’s theme, although I’m not happy with it; interestingly, the default theme almost works on 16-custom-colours light terminal scheme, but not quite on the dark one.
- Mutt, which is both in the main combined repository but also on the separate one. I’m not really happy with mutt’s theme either, but that seems mostly because I was using a quite different theme before. I’ll try to improve what I feel is missing over time.
- dircolors; I found this to be an absolute requirement for good readability of
ls --color, as the defaults are too bad
- I also took the opportunity to unify my
colordifftheme, but this was not really something that I found and took ‘as-is’ from some repository; I basically built my own theme.
16 vs 256 colours
The solarized theme/configuration can be done in two ways:
- by changing the Xresources/terminal 16 basic colours to custom RGB values, or:
- by using approximations from the fixed 256 colours available in the xterm-256color terminfo
Upstream recommends the custom ones, as they are precisely tuned, instead of using the approximated ones; honestly I don’t know if they would make a difference. It’s too bad upstream went silent a few years back, as technically it’s possible to override also colours above 16 in the 256-colour palette, but in any case, each of the two options has its own cons:
- using customised 16-colour means that all terminal programs get the new colours scheme, even if they were designed (colour-wise) based on the standard values; this makes some things pretty unreadable (hence the need to fix dircolors), but at least somewhat consistent.
- using 256-colour palette, unchanged programs stay the same, but now they look very different than the programs that were updated to solarized; note thought I haven’t tested this, but that’s how I understand things would be.
So either way it’s not perfect.
Also not perfect is that for proper consistent look, many more programs would have to be changed; but I don’t see that happening in today’s world. I’ve seen for example 3 or 4 Midnight Commander themes, but none of them were actually in the spirit of solarized, even though they were tweaked for solarized.
Even between vim and emacs, which both have one canonical solarized theme, the look is close but not really the same (looking at the markdown source for this blog post: URLs, headers and spelling mistakes are all different), but this might be due not necessarily the theme itself.
So no global theme consistency (I’d wish), but still, I find this much better on the eyes and not lower on readability after getting used to it.