public function colored($text, $color)
    {
        $colors = [
            'black'  => '0;30',
            'red'    => '0;31',
            'green'  => '0;32',
            'blue'   => '1;34',
            'yellow' => '1;33'
        ];

        $c = (
            array_key_exists($color, $colors)
            ? $colors[$color]
            : $colors['black']
        );

        if ($this->arguments->{'no-colors'}) {
            return $text;
        } else {
            return "\033[". $c . 'm' . $text . "\033[0m";
        }
    }
public function colored($text, $color)
    {
        $colors = [
            'black'  => '0;30',
            'red'    => '0;31',
            'green'  => '0;32',
            'blue'   => '1;34',
            'yellow' => '1;33'
        ];

        $c = (
            array_key_exists($color, $colors)
            ? $colors[$color]
            : $colors['black']
        );

        if ($this->arguments->{'no-colors'}) {
            return $text;
        } else {
            return "\033[". $c . 'm' . $text . "\033[0m";
        }
    }
public function colored ( $ text , $ color ) { $ colors = [ 'black' => '0;30' , 'red' => '0;31' , 'green' => '0;32' , 'blue' => '1;34' , 'yellow' => '1;33' ] ; $ c = ( array_key_exists ( $ color , $ colors ) ? $ colors [ $ color ] : $ colors [ 'black' ] ) ; if ( $ this -> arguments -> { 'no-colors' } ) { return $ text ; } else { return "\033[" . $ c . 'm' . $ text . "\033[0m" ; } }
Returned colored text
@param string $text
@param string $color
@return string
Returned colored text