Only use colours if outputting directly to the terminal rather than a pipe or file.  This is to eliminate writing escape codes to files or other processes.