format: support 256 colors and backgrounds in formats
This commit is contained in:
@@ -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));
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user