Fix some mistakes in ANSI escape codes

This commit is contained in:
Martchus 2018-01-29 16:26:28 +01:00
parent e3310792d3
commit d6361e1cfd
2 changed files with 3 additions and 3 deletions

View File

@ -65,13 +65,13 @@ std::ostream &operator<<(std::ostream &stream, Phrases phrase)
setStyle(stream, TextAttribute::Bold);
break;
case Phrases::ErrorMessage:
setStyle(stream, Color::Green, ColorContext::Foreground, TextAttribute::Bold);
setStyle(stream, Color::Red, ColorContext::Foreground, TextAttribute::Bold);
stream << "==> ERROR: ";
setStyle(stream, TextAttribute::Reset);
setStyle(stream, TextAttribute::Bold);
break;
case Phrases::WarningMessage:
setStyle(stream, Color::Green, ColorContext::Foreground, TextAttribute::Bold);
setStyle(stream, Color::Yellow, ColorContext::Foreground, TextAttribute::Bold);
stream << "==> WARNING: ";
setStyle(stream, TextAttribute::Reset);
setStyle(stream, TextAttribute::Bold);

View File

@ -46,7 +46,7 @@ inline void setStyle(std::ostream &stream, Color foregroundColor, Color backgrou
{
if (enabled) {
stream << '\e' << '[' << static_cast<char>(displayAttribute) << ';' << static_cast<char>(ColorContext::Foreground)
<< static_cast<char>(foregroundColor) << ';' << static_cast<char>(ColorContext::Foreground) << static_cast<char>(backgroundColor)
<< static_cast<char>(foregroundColor) << ';' << static_cast<char>(ColorContext::Background) << static_cast<char>(backgroundColor)
<< 'm';
}
}