protected static function color($txt, $color = 'DEFAULT')
{
if (PHP_SAPI === 'cli') {
// only color if output is a posix TTY
if (function_exists('posix_isatty') && posix_isatty(STDOUT)) {
$color = static::$TERM_COLORS[$color];
$txt = chr(27) . "[0;{$color}m{$txt}" . chr(27) . "[00m";
}
// otherwise, don't touch $txt
} else {
$color = strtolower($color);
$txt = "<span style=\"color: {$color};\">{$txt}</span>";
}
return $txt;
}