Показать сообщение отдельно

  #6766  
Старый 28.02.2023, 21:25
EclipsedFlow
Познавший АНТИЧАТ
Регистрация: 18.09.2017
Сообщений: 1,044
С нами: 4553429

Репутация: 153


По умолчанию

Цитата:
Сообщение от !Sam#0235  

C++:





Код:
static
float
color
[
3
]
{
0.0f
,
0.0f
,
0.0f
}
;


Color is written as INT

C++:





Код:
if
(
!
ImGui
::
ColorEdit3
(
"Color"
,
color
,
ImGuiColorEditFlags_PickerHueWheel
)
)
{
set_int_to_ini
(
INI_SECTION
,
INI_KEYR1
,
std
::
to_string
(
int
(
color
[
0
]
*
255
)
)
)
;
set_int_to_ini
(
INI_SECTION
,
INI_KEYG1
,
std
::
to_string
(
int
(
color
[
1
]
*
255
)
)
)
;
set_int_to_ini
(
INI_SECTION
,
INI_KEYB1
,
std
::
to_string
(
int
(
color
[
2
]
*
255
)
)
)
;
}


I need some function to take the color from the .INI itself that does not cause me problems, since the function that I use takes them like this:



Can anyone help me or know of a better way to do this?
C++:





Код:
ImVec4 color
=
{
0.0f
,
0.0f
,
0.0f
,
0.0f
}
;
ImGui
::
ColorEdit4
(
"Color"
,
(
float
*
)
&
color
,
ImGuiColorEditFlags_PickerHueWheel
)
;
ImU32 color_hex
=
ImColor
(
color
)
;
// or
ImU32 color_hex
=
ImGui
::
GetColorU32
(
color
)
;
 
Ответить с цитированием