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

Urwid High Colour Support

Urwid palette_test.py on rxvt
Posted on 2009-01-19.

The latest development version of Urwid's raw_display module now supports 88 and 256-colour modes. Colour modes now also support underline, standout, and bold(separate from bright colours when available.)

The default high colour palettes include a colour cube (4x4x4 or 6x6x6) and a gray scale (8 or 24 values.) I made the assumption that most application developers won't care whether a user has 88 or 256 colours, just that they have more than the usual 16. This led me to the following naming scheme for high colours:

For colour cube and gray scale values Urwid will choose the closest match available in the high colour mode that is active. The palette_test.py application shows all the available values in each mode.

When creating a palette the high-colour foreground and background settings now follow the monochrome setting. The standout, underline and bold settings may now be appended to the normal and high-colour foreground colours with a comma, eg: 'light gray,underline'. The monochrome settings used to have to be in a tuple, but now a comma-separated string will work as well: ('underline','bold') becomes 'underline,bold'.

Tags: Urwid Python