Ian Ward

CKAN contributor/tech lead
Urwid author
PyRF contributor
Speedometer author

Contributing to Open Source
IASA E-Summit, 2014-05-16
Urwid Applications
Urwid Intro
Unfortunate Python
Django 1.1

Moving to Python 3
Article Tags


Ian Ward's email:
first name at this domain

wardi on OFTC, freenode and github

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: ./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