File tree Expand file tree Collapse file tree 1 file changed +16
-2
lines changed
libmambapy/src/libmambapy/bindings Expand file tree Collapse file tree 1 file changed +16
-2
lines changed Original file line number Diff line number Diff line change 17
17
18
18
namespace mambapy
19
19
{
20
+ // NOTE: These fmt "internals" are for internal use only.
21
+ // External users should not use them in their projects.
22
+ // Instead, rely on the public API or appropriate abstractions.
23
+ // (not sure if they exist at the moment for this specific use case though)
24
+ // cf. https://github.com/fmtlib/fmt/issues/4466
25
+ bool fmt_is_rgb (const fmt::detail::color_type& color_type)
26
+ {
27
+ #if FMT_VERSION >= 110200
28
+ return !color_type.is_terminal_color ();
29
+ #else
30
+ return color_type.is_rgb ;
31
+ #endif
32
+ }
33
+
20
34
void bind_submodule_utils (pybind11::module_ m)
21
35
{
22
36
namespace py = pybind11;
@@ -110,7 +124,7 @@ namespace mambapy
110
124
return std::nullopt;
111
125
}
112
126
const auto fg = style.get_foreground ();
113
- if (fg. is_rgb )
127
+ if (fmt_is_rgb (fg) )
114
128
{
115
129
return { { fmt::rgb (fg.value .rgb_color ) } };
116
130
}
@@ -126,7 +140,7 @@ namespace mambapy
126
140
return std::nullopt;
127
141
}
128
142
const auto bg = style.get_background ();
129
- if (bg. is_rgb )
143
+ if (fmt_is_rgb (bg) )
130
144
{
131
145
return { { fmt::rgb (bg.value .rgb_color ) } };
132
146
}
You can’t perform that action at this time.
0 commit comments