diff options
-rw-r--r-- | include/tools/color.hxx | 13 |
1 files changed, 8 insertions, 5 deletions
diff --git a/include/tools/color.hxx b/include/tools/color.hxx index fa62f28f362b..cf11e0ae9df2 100644 --- a/include/tools/color.hxx +++ b/include/tools/color.hxx @@ -320,11 +320,14 @@ constexpr ::Color COL_AUTHOR9_LIGHT ( 255, 231, 199 ); template<typename charT, typename traits> inline std::basic_ostream<charT, traits>& operator <<(std::basic_ostream<charT, traits>& rStream, const Color& rColor) { - return rStream << "c[" << std::hex << std::setfill ('0') - << std::setw(2) << static_cast<int>(rColor.GetRed()) - << std::setw(2) << static_cast<int>(rColor.GetGreen()) - << std::setw(2) << static_cast<int>(rColor.GetBlue()) - << std::setw(2) << static_cast<int>(rColor.GetTransparency()) << "]"; + std::ios_base::fmtflags nOrigFlags = rStream.flags(); + rStream << "c[" << std::hex << std::setfill ('0') + << std::setw(2) << static_cast<int>(rColor.GetRed()) + << std::setw(2) << static_cast<int>(rColor.GetGreen()) + << std::setw(2) << static_cast<int>(rColor.GetBlue()) + << std::setw(2) << static_cast<int>(rColor.GetTransparency()) << "]"; + rStream.setf(nOrigFlags); + return rStream; } #endif |