Skip to content

Commit 0271475

Browse files
committed
Cleanup
1 parent 52afc1c commit 0271475

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

include/fmt/color.h

+3-3
Original file line numberDiff line numberDiff line change
@@ -205,7 +205,7 @@ struct rgb {
205205

206206
namespace detail {
207207

208-
// a bit-packed variant of either an rgb color or a terminal color.
208+
// a bit-packed variant of an RGB color, a terminal color, or unset color.
209209
// see text_style for the bit-packing scheme.
210210
struct color_type {
211211
FMT_CONSTEXPR color_type() noexcept = default;
@@ -347,13 +347,13 @@ class text_style {
347347
/// Creates a text style from the foreground (text) color.
348348
FMT_CONSTEXPR inline auto fg(detail::color_type foreground) noexcept
349349
-> text_style {
350-
return foreground.value_ | (1ULL << 24);
350+
return foreground.value_;
351351
}
352352

353353
/// Creates a text style from the background color.
354354
FMT_CONSTEXPR inline auto bg(detail::color_type background) noexcept
355355
-> text_style {
356-
return (background.value_ | (1ULL << 24)) << 27;
356+
return static_cast<uint64_t>(background.value_) << 27;
357357
}
358358

359359
FMT_CONSTEXPR inline auto operator|(emphasis lhs, emphasis rhs) noexcept

0 commit comments

Comments
 (0)