public static function colorize($text, $fgcolor = null, $bgcolor = null)
    {
        $colors = '';
        if ($bgcolor) {
            $colors .= self::getBgColorString(self::getColorCode($bgcolor));
        }
        if ($fgcolor) {
            $colors .= self::getFgColorString(self::getColorCode($fgcolor));
        }
        if ($colors) {
            $text = $colors . $text . self::RESET;
        }
        return $text;
    }
public static function colorize($text, $fgcolor = null, $bgcolor = null)
    {
        $colors = '';
        if ($bgcolor) {
            $colors .= self::getBgColorString(self::getColorCode($bgcolor));
        }
        if ($fgcolor) {
            $colors .= self::getFgColorString(self::getColorCode($fgcolor));
        }
        if ($colors) {
            $text = $colors . $text . self::RESET;
        }
        return $text;
    }
public static function colorize ( $ text , $ fgcolor = null , $ bgcolor = null ) { $ colors = '' ; if ( $ bgcolor ) { $ colors .= self :: getBgColorString ( self :: getColorCode ( $ bgcolor ) ) ; } if ( $ fgcolor ) { $ colors .= self :: getFgColorString ( self :: getColorCode ( $ fgcolor ) ) ; } if ( $ colors ) { $ text = $ colors . $ text . self :: RESET ; } return $ text ; }
Returns a colorized string

@param string $text
@param string $fgcolor (a key from the $foregroundColors array)
@param string $bgcolor (a key from the $backgroundColors array)
@return string
Returns a colorized string