+
+ if ($result->options['colors'] !== null) {
+ $this->colors = $result->options['colors'];
+ } else if ($result->options['nocolors'] !== null) {
+ $this->colors = !$result->options['nocolors'];
+ } else {
+ //default coloring to enabled, except
+ // when piping | to another tool
+ $this->colors = true;
+ if (function_exists('posix_isatty')
+ && !posix_isatty(STDOUT)
+ ) {
+ $this->colors = false;
+ }
+ }