From facb10c91febd4426bf710aceec86239197b89a7 Mon Sep 17 00:00:00 2001 From: chatlanin Date: Wed, 25 Feb 2026 14:22:39 +0300 Subject: [PATCH] fix hex to u32 --- src/vertex_engine/utils/define.hpp | 2 +- src/vertex_engine/utils/func.hpp | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/src/vertex_engine/utils/define.hpp b/src/vertex_engine/utils/define.hpp index 52d2157..223d7f5 100755 --- a/src/vertex_engine/utils/define.hpp +++ b/src/vertex_engine/utils/define.hpp @@ -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(glGetString(n)) diff --git a/src/vertex_engine/utils/func.hpp b/src/vertex_engine/utils/func.hpp index f38215a..b05920d 100644 --- a/src/vertex_engine/utils/func.hpp +++ b/src/vertex_engine/utils/func.hpp @@ -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,