Only use colors when printing to a terminal.

Fixes issue #144.