yhdev/dat/dump-nccolour

103 lines
3 KiB
Text

=pod
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.
B<Source code: > L<nccolour.c|http://dev.yorhel.nl/download/code/nccolour.c>
(L<syntax highlighed version|http://p.blicky.net/xu35c>)
Some screenshots can be found below, but more screenshots are always welcome!
Please send your (.png) screenshots to projects@yorhel.nl.
=head2 Notes / observations
=over
=item * The most obvious conclusion: the displayed colours do not have the
exact same colour value in every terminal. Some terminals also allow users to
modify these colours.
=item * You can not assume that the default foreground or background colour can
be represented by one of the 8 basic colours defined by NCurses.
=item * Specifying -1 as colour, to indicate the default foreground or
background colour, seems to work fine in any terminal tested so far.
=item * All tested terminals render the foreground colour in a lighter shade
when the A_BOLD attribute is set. This does not apply to the background colour.
The result of this is that the text becomes visible when using A_BOLD when the
foreground and background colour are set to the same value.
=item * Unfortunately, not all terminals are configured in such a way that all
possible colours are readable. So as a developer you'll still have to support
configurable colour schemes in your ncurses application. :-(
=item * On most terminals, setting the foreground and background colour to the
same value without applying the A_BOLD attribute will make the text invisible.
Don't rely on this, however, as this is not the case on OS X.
=back
=head2 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.
[img scr nccol-full.png ]
=head2 Screenshots
=over
=item Arch Linux, Roxterm, Default color scheme
[img scr nccol-rox-b.png ]
=item Arch Linux, Roxterm, GTK color scheme
[img scr nccol-rox-w.png ]
=item Arch Linux, Roxterm, Tango color scheme
[img scr nccol-rox-t.png ]
=item Arch Linux, Roxterm, Modified Tango color scheme
[img scr nccol-rox-c.png ]
=item Arch Linux, xterm (default settings)
[img scr nccol-xterm.png ]
=item Ubuntu 11.10, Gnome-terminal
[img scr nccol-ubuntu.png ]
=item Debian Squeeze, VT (default settings)
[img scr nccol-debian.png ]
=item FreeBSD, VT (default settings)
[img scr nccol-fbsd.png ]
=item Mac OS X, Terminal
[img scr nccol-osx-terminal.png ]
=item Mac OS X, iTerm2
[img scr nccol-osx-iterm2.png ]
=item CentOS 6.4
[img scr nccol-centos64.png ]