diff --git a/src/Color3.cpp b/src/Color3.cpp index ef4d2c6..ae89fef 100644 --- a/src/Color3.cpp +++ b/src/Color3.cpp @@ -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}; }