public static function color($text, $foreground, $background = null)
    {
        $foreground = self::$colors[$foreground];
        $code = "\x03".$foreground;
        
        if ($background !== null) {
            $background = self::$colors[$background];
            $code .= ','.$background;
        }
        
        return $code.$text."\x03";
    }
public static function color($text, $foreground, $background = null)
    {
        $foreground = self::$colors[$foreground];
        $code = "\x03".$foreground;
        
        if ($background !== null) {
            $background = self::$colors[$background];
            $code .= ','.$background;
        }
        
        return $code.$text."\x03";
    }
public static function color ( $ text , $ foreground , $ background = null ) { $ foreground = self :: $ colors [ $ foreground ] ; $ code = "\x03" . $ foreground ; if ( $ background !== null ) { $ background = self :: $ colors [ $ background ] ; $ code .= ',' . $ background ; } return $ code . $ text . "\x03" ; }
Applies colors to the text
@param  string $text       Text to format
@param  string $foreground Foreground color
@param  string $background Background color (optional)
@return string             Coloured text
Applies colors to the text