Fix Color3::FromHex format.
This commit is contained in:
@@ -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.
|
// TODO: Support 9-character hex codes (with alpha), but raise a warning that suggests using Color4 instead.
|
||||||
if (hexCode.length() == 7) {
|
if (hexCode.length() == 7) {
|
||||||
u8 r, g, b;
|
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};
|
return {r, g, b};
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user