public static function colorizeLines($text, $fgcolor = null, $bgcolor = null)
    {
        $lines = explode("\n", $text);
        foreach ($lines as &$line) {
            $line = self::colorize($line, $fgcolor, $bgcolor);
        }
        return implode("\n", $lines);
    }