Add option to use color codes in non-tty contexts

Fixes #325