Daily Archive for June 17th, 2013

Creating Terminal Color Palettes with Inkscape

So, I’m moving. I’m saying goodbye to my native land of Boston and pitching my tent in San Francisco for the forseeable future. Exciting! More on that later. The reason why I’m writing this now is because I’d like to point out that I get really, really bored on planes. So, I try to occupy myself with stupid things until I land or my battery runs out.

It started with the fact that I wanted to modify my terminal color scheme a bit. I opened up Inkscape, created a bunch of squares one for each color, and then carefully copied my current scheme over by editing the RGB values of the squares. Then, I messed with the colors, and copied all the RGB values back to my [cci]~/.Xdefaults[/cci]. This was pretty tedious. I wanted a better way to come up with new schemes.

So, I decided to write a simple script that would extract colors from an SVG file and generate lines for Xresources, TTY escape codes, etc. The result is color-control.

Using the provided [cci]example.svg[/cci], you can edit the colors to your liking with your favorite vector graphics editor and then run [cci]extract-colors.py[/cci] to generate configuration lines.

It’s not great, but whatever, it kept my mind occupied for a little while on the plane.