diff --git a/include/spdlog/sinks/wincolor_sink-inl.h b/include/spdlog/sinks/wincolor_sink-inl.h index 696db566..d5ae43ce 100644 --- a/include/spdlog/sinks/wincolor_sink-inl.h +++ b/include/spdlog/sinks/wincolor_sink-inl.h @@ -121,7 +121,7 @@ wincolor_sink::set_foreground_color_(std::uint16_t attribs) { } // change only the foreground bits (lowest 4 bits) - auto new_attribs = static_cast(attribs) | (orig_buffer_info.wAttributes & 0xfff0); + auto new_attribs = static_cast(attribs) | (orig_buffer_info.wAttributes & 0xff00); auto ignored = ::SetConsoleTextAttribute(static_cast(out_handle_), static_cast(new_attribs)); (void)(ignored);