framework/console/Controller.php
public function isColorEnabled($stream = \STDOUT)
    {
        return $this->color === null ? Console::streamSupportsAnsiColors($stream) : $this->color;
    }
public function isColorEnabled($stream = \STDOUT)
    {
        return $this->color === null ? Console::streamSupportsAnsiColors($stream) : $this->color;
    }
Returns a value indicating whether ANSI color is enabled.

ANSI color is enabled only if [[color]] is set true or is not set
and the terminal supports ANSI color.

@param resource $stream the stream to check.
@return bool Whether to enable ANSI style in output.