src/System/Console/Style.php
public static function apply($text, $foreground = '', $background = '')
    {
        try {
            $style = new OutputFormatterStyle();
            if ($foreground != '') {
                $style->setForeground($foreground);
            }
            if ($background != '') {
                $style->setBackground($background);
            }
            return $style->apply($text);
        } catch (\Exception $e) {
            return $text;
        }
    }
public static function apply($text, $foreground = '', $background = '')
    {
        try {
            $style = new OutputFormatterStyle();
            if ($foreground != '') {
                $style->setForeground($foreground);
            }
            if ($background != '') {
                $style->setBackground($background);
            }
            return $style->apply($text);
        } catch (\Exception $e) {
            return $text;
        }
    }
public static function apply ( $ text , $ foreground = '' , $ background = '' ) { try { $ style = new OutputFormatterStyle ( ) ; if ( $ foreground != '' ) { $ style -> setForeground ( $ foreground ) ; } if ( $ background != '' ) { $ style -> setBackground ( $ background ) ; } return $ style -> apply ( $ text ) ; } catch ( \ Exception $ e ) { return $ text ; } }
Apply foreground and background color.

@param string $text
@param string $foreground Default ''.
@param string $background Default ''.
@return string
Apply foreground and background color .