output colours only if stdout is a tty
replace index() by strchr()
document ===