From 43e263b88fff5b171490206eed85462b12198fe4 Mon Sep 17 00:00:00 2001 From: mf85 <39129074+mf85@users.noreply.github.com> Date: Fri, 28 Mar 2025 07:25:07 +0100 Subject: [PATCH] Update TmxColor.cpp If alpha channel is higher than 127 and lower than 255 , strtol conversion returns wrong color --- src/TmxColor.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/TmxColor.cpp b/src/TmxColor.cpp index edb61dd..3d09493 100644 --- a/src/TmxColor.cpp +++ b/src/TmxColor.cpp @@ -57,7 +57,7 @@ namespace Tmx Color::Color(const std::string& str) { // We skip the first # character and then read directly the hexadecimal value - color = std::strtol((str.c_str() + 1), nullptr, 16); + color = std::strtoul((str.c_str() + 1), nullptr, 16); // If the input has the short format #RRGGBB without alpha channel we set it to 255 if(str.length() == 7) color |= 0xff000000;