Yoran Heling
projects@yorhel.nl
home - git repos
= donate =paypal
= pgp =only used for releases
key - mit
7446 0D32 B808 10EB A9AF A2E9 6239 4C69 8C27 39FA
Cute decorative scissors, cutting through your code.

Colours in NCurses

I decided to do some experimentation with how the colours defined in ncurses are actually displayed in terminals, what the effects are of combining these colours with other attributes, and how colour schemes of a terminal can affect the displayed colours. To this end I wrote a small c file and ran it in different terminals and different configurations. Note that only the 8 basic NCurses colours are tested, the more flexible init_color() function is not used.

Source code: nccolour.c (syntax highlighed version)

Notes / observations

Full screenshot

To avoid wasting unecessary space, the comparison screenshots below only display the colour table. Here's a screenshot of the full output of the program, which also explains what each column means.

Screenshots

Arch Linux, Roxterm, Default color scheme

Arch Linux, Roxterm, GTK color scheme

Arch Linux, Roxterm, Tango color scheme

Arch Linux, Roxterm, Modified Tango color scheme

Arch Linux, xterm (default settings)

Ubuntu 11.10, Gnome-terminal

Debian Squeeze, VT (default settings)

FreeBSD, VT (default settings)

Mac OS X, Terminal

Mac OS X, iTerm2

CentOS 6.4