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;
    }