fix hex to u32

This commit is contained in:
2026-02-25 14:22:39 +03:00
parent b530ae06d9
commit facb10c91f
2 changed files with 3 additions and 3 deletions

View File

@@ -21,6 +21,6 @@
#define VE_NO_NAME(n) VE::func::name(n).data()
#define VE_NAME(n) VE::func::name(n, "").data()
#define VE_COLOR(c, t) VE::func::color(c, t)
#define VE_COLOR(c, t) VE::func::colorU32(c, t)
#define VE_GLGETSTRING(n) reinterpret_cast<const char*>(glGetString(n))

View File

@@ -10,7 +10,7 @@ namespace VE::func
return key_no_name + n;
}
inline ImU32 color(std::string hex, unsigned char alpha = 255)
inline ImU32 colorU32(std::string hex, unsigned char alpha = 255)
{
if (hex[0] == '#') hex.erase(0, 1);
@@ -33,7 +33,7 @@ namespace VE::func
// Парсим HEX
if (hex.length() >= 6) std::sscanf(hex.c_str(), "%2x%2x%2x", &r, &g, &b);
// Конвертируем в float (0.0-1.0)
return ImVec4(
r / 255.0f,