function applyStyle($text, $styles = [])
    {
        if (!self::$supported)
            return $text;

        if (is_string($styles))
        {
            $styles = [$styles];
        }

        $output = $text;
        foreach ($styles as $style) {
            if (isset(self::$theme[$style])) {
                $output = $this->applyStyle($output, self::$theme[$style]);
            } else {
                if (isset(self::$styles[$style])) {
                    $pre  = $this->escSequence(self::$styles[$style]);
                    $post = $this->escSequence(0);
                } else {
                    $pre = $post = '';
                }

                $output = $pre . $output . $post;
            }
        }

        return $output;
    }
function applyStyle($text, $styles = [])
    {
        if (!self::$supported)
            return $text;

        if (is_string($styles))
        {
            $styles = [$styles];
        }

        $output = $text;
        foreach ($styles as $style) {
            if (isset(self::$theme[$style])) {
                $output = $this->applyStyle($output, self::$theme[$style]);
            } else {
                if (isset(self::$styles[$style])) {
                    $pre  = $this->escSequence(self::$styles[$style]);
                    $post = $this->escSequence(0);
                } else {
                    $pre = $post = '';
                }

                $output = $pre . $output . $post;
            }
        }

        return $output;
    }
function applyStyle ( $ text , $ styles = [ ] ) { if ( ! self :: $ supported ) return $ text ; if ( is_string ( $ styles ) ) { $ styles = [ $ styles ] ; } $ output = $ text ; foreach ( $ styles as $ style ) { if ( isset ( self :: $ theme [ $ style ] ) ) { $ output = $ this -> applyStyle ( $ output , self :: $ theme [ $ style ] ) ; } else { if ( isset ( self :: $ styles [ $ style ] ) ) { $ pre = $ this -> escSequence ( self :: $ styles [ $ style ] ) ; $ post = $ this -> escSequence ( 0 ) ; } else { $ pre = $ post = '' ; } $ output = $ pre . $ output . $ post ; } } return $ output ; }
Returns the text with the styles applied to it

@param string
@param string|array

@return string
Returns the text with the styles applied to it