format: support 256 colors and backgrounds in formats

This commit is contained in:
Andrzej Rybczak
2014-11-11 12:42:25 +01:00
parent 6c422da3c9
commit 7d2ac5daa4

View File

@@ -132,7 +132,7 @@ expressions<CharT> parseBracket(const string<CharT> &s,
unsigned delimiter = 0;
if (isdigit(*it))
{
std::string sdelimiter;
string<CharT> sdelimiter;
do
sdelimiter += *it++;
while (it != end && isdigit(*it));
@@ -185,6 +185,19 @@ expressions<CharT> parseBracket(const string<CharT> &s,
else
throwError(s, it, invalidCharacter(*it));
}
else if (*it == '(')
{
++it;
rangeCheck(s, it, end);
string<CharT> scolor;
do
scolor += *it++;
while (it != end && *it != ')');
rangeCheck(s, it, end);
result.push_back(boost::lexical_cast<NC::Color>(
convertString<char, CharT>::apply(scolor)
));
}
else
throwError(s, it, invalidCharacter(*it));
}