Fix Color3::FromHex format.

This commit is contained in:
2025-06-04 13:10:34 -05:00
parent ce624106f9
commit cc4773abba

View File

@@ -20,7 +20,7 @@ Color3 Color3::FromHex(const std::string &hexCode) {
// TODO: Support 9-character hex codes (with alpha), but raise a warning that suggests using Color4 instead.
if (hexCode.length() == 7) {
u8 r, g, b;
std::sscanf(hexCode.c_str(), "#%02x%02x%02x", &r, &g, &b);
std::sscanf(hexCode.c_str(), "#%02hhx%02hhx%02hhx", &r, &g, &b);
return {r, g, b};
}