Add a colour test function.

Imported from https://code.google.com/p/iterm2/source/browse/trunk/tests/colors.sh