excess.org

Ian Ward

Consulting
Generic Consulting Inc.
Software
Urwid 2010-01-25 (0.9.9.1)
Speedometer 2008-05-29 (2.6)
Templayer 2009-03-08 (1.5.1)
mkzip.py 2003-09-15 (1.2)
File Tosser 2001 (0.1e-6)
Writing
Tags

Home

Ian Ward's email:
first name at this domain

IRC: wardi on OFTC

Facebook profile

Locations of visitors to this page

XTerm 256-Colour Chart

XTerm 256-Colour Chart
Posted on 2007-06-09, last modified 2007-10-20.

UPDATE a new version is available, see: XTerm 256-Colour Chart 2.0

I have written a small utility that can display a chart of the 256 colours supported by XTerm or the 88 colours supported by Rxvt.

Instead of the usual sliced-colour-cube view of the available colours, I decided to “unwrap” the cube. The shape of the chart is irregular for this reason. Unwrapping the cube in this way separates out the neutral colours from the colours on the outside of the cube.

xterm_colour_chart.py: browse source / download

Usage

Usage: ./xterm_colour_chart.py [-88] [-n] [-r]

 -88   Use 88-colour mode (default: 256-colour mode)
 -n    Display hex numbers on the colour chart
 -r    Reset colour palette to defaults

The chart shows neutral colours on the right and the outside of the
colour cube "unwrapped" on the left.  The chart is irregularly shaped 
to maximize the numbers of neighboring colour displayed as neighbors.

I would like to improve this code to display the different corners of the cube at different locations on the chart, at some point in the future. I am accepting patches to this code, if it generates any interest, I might make a proper project out of it.

Urwid will soon have support for 256 and 88-colour modes, and this utility was inspired by that work.

Tags: Urwid Python