When you’re reading a book outside, a shady spot can offer respite from the sun’s bright rays on your book’s pages. Wouldn’t it be nice to bring the effects of a shady environment to your computer screen, saving your eyes from the harshness of black-on-white backlit text? Solarized can make that wish a reality.
Solarized, a color scheme developed by Ethan Schoonover, transforms your Linux terminals and applications with a simple 16-color palette you can apply in a matter of minutes. It offers a mix of low contrast, reduced brightness and readability to reduce eye strain and maximize ease of use.
In this article we will discuss the theory behind Schoonover’s creation and dig into the basics of how you can apply his color scheme to your favorite terminal.
Inspiration and Theory
Schoonover indicates in his website that he loves to read outside and in the shade. He tries to find a place under a tree where the shade offers a nice dimming effect from the harsh direct sunlight – a place where “shaded paper contrasts with … crisp text nicely.”
In that setting, the contrast between the text and its white background is lower than the contrast you would find on your computer monitor that displays black text on a white backdrop. The latter situation, unfortunately, can strain the eyes; it is also a situation many computer users find themselves in.
Solarized combats this with sixteen colors (eight base tones and eight accent colors) that replicate the subdued nature of a shady spot. The colors come from the CIELAB color space and are designed with fixed lightness relationships so that, when they’re grouped together, they don’t strain your eyes. Check out Schoonover’s website for a quick look at the color space.
The color swatches at the top of that screenshot match the colors used in the light- and dark-style terminals shown below them. You can apply either the light or dark color scheme to your own terminals with a simple copy/paste into an “.Xresources” file.
Installation and Application
If you haven’t yet grabbed the necessary files from the Solarized website, do so now with git:
git clone git://github.com/altercation/solarized.git
or download the zip file here.
Unpack the zip file if necessary. Then enter the Solarized directory and its “xresources” subdirectory.
Now copy the entire text from the “./solarized” text file into your “$HOME/.Xresources” file.
Each line in the “.Xresources” file preceded by an exclamation point is commented out. You can see that the collection of light colors is commented out, so if you used Solarized now, your terminal would apply the dark theme. If you want to apply the light theme, uncomment the light colors and comment the dark colors so your text looks like the following image.
To apply the changes, reload your “.Xresources” file.
Open a new terminal to reveal the new color scheme.
Solarized in Other Applications
This application of new colors will work well in many terminals, but Schoonover has also developed color swatches for specific applications.
In your base “solarized” directory, you can find specific installation instructions for terminal applications such as Vim, Emacs, and Mutt and graphical applications such as Photoshop and GIMP. The “README.md” text file in each directory explains these instructions.
Some terminals like the Xfce terminal also rely on config files other than “.Xresources,” so you may find your chosen terminal listed in its own directory. If our .Xresources instructions listed above did not work, you may need to follow a README.
Note: In Photoshop and GIMP you are installing a color palette, not forcing the GUI elements of the program to use the Solarized color scheme. Schoonover marks these variations of use in the name of each subdirectory, including “vim-colors-solarized” and “adobe-swatches-solarized.” The words “colors” and “swatches” in those names respectively denote whether you will change the look of an application or will offer the application a selection of colors to use in its operation.
The major difference between the “.Xresources” installation covered here and these additional installation procedures is that you may be asked to edit unique configuration files. Instructions for Vim ask that you edit its “.vimrc” file, for instance. You may also have to restart the application to see any changes take effect.
Applying the Solarized color palette only takes a few minutes, but its effects can be dramatic. I began using it several years ago to decrease my headaches associated with eye strain. It helped so much that I continued using it every day.
I now recommend Solarized every chance I get for its practicality and attractiveness. It has made computer use a much more pleasant experience for me. I hope you also find it worthwhile.