excess.org

Ian Ward

Consulting
Generic Consulting Inc.
Software
Urwid 2011-11-28 (1.0.1)
Speedometer 2011-12-08 (2.8)

Writing
Moving to Python 3
2011-02-17

Presentations
Unfortunate Python
2011-12-19
Django 1.1
2009-05-16
Tags

Home

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