Only show ansi colors if stdout is a tty

Only show ansi colors if stdout is a tty. This is to avoid seeing the ansi codes when the script output is redirected.