If I can get both values that would be great, if not enough with string hex color
C++:
Код:
ImVec4 color
{
}
;
// ImGui::ColorEdit
unsigned
long
u32_color
=
IM_COL32
(
color
.
x
,
color
.
y
,
color
.
z
,
color
.
w
)
;
// or
auto
u32_color
=
ImGui
::
ColorConvertFloat4ToU32
(
color
)
;
convert to hex string:
C++:
Код:
std
::
string str_color
{
}
;
str_color
.
reserve
(
8
)
;
// SSO is used, there isn't allocation. Just in case
std
::
to_chars
(
str_color
.
data
(
)
,
str_color
.
data
(
)
+
str_color
.
capacity
(
)
,
u32_color
,
16
)
;