Bug Fix - Color endianness

- Fixed "bug" that caused "red on black" to be emitted as ^[[40;31m
  instead of the expected ^[[31;40m, which is what the unit tests are
  looking for.
This commit is contained in:
Paul Beckingham 2009-10-11 11:49:35 -04:00
parent 1bb907f76d
commit 179b51278f
2 changed files with 8 additions and 8 deletions

View file

@ -465,18 +465,18 @@ std::string Color::colorize (const std::string& input)
result << "4";
}
if (value & _COLOR_HASBG)
{
if (count++) result << ";";
result << ((value & _COLOR_BRIGHT ? 99 : 39) + ((value & _COLOR_BG) >> 8));
}
if (value & _COLOR_HASFG)
{
if (count++) result << ";";
result << (29 + (value & _COLOR_FG));
}
if (value & _COLOR_HASBG)
{
if (count++) result << ";";
result << ((value & _COLOR_BRIGHT ? 99 : 39) + ((value & _COLOR_BG) >> 8));
}
result << "m" << input << "\033[0m";
return result.str ();
}