(from http://excess.org/article/2009/01/urwid-high-colour-support/ )

The latest [development version of Urwid][1]'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:

  * `#000` .. `#fff` for colours in the colour-cube
  * `g0` ... `g100` for values in the gray scale (`g#00` .. `g#ff` also 
work)
  * `h0` ... `h87` or `h255` for a precise colour

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][2] 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'`.


[1]: https://excess.org/hg/urwid/
[2]: https://excess.org/hg/urwid/file/a5314d585db4/palette_test.py


_______________________________________________
Urwid mailing list
[email protected]
http://lists.excess.org/mailman/listinfo/urwid

Reply via email to