fix clang-check warnings
This commit is contained in:
+4
-4
@@ -92,11 +92,11 @@ glm::vec4 Attribute::asColor() const {
|
||||
throw std::runtime_error("#RRGGBB or #RRGGBBAA required");
|
||||
}
|
||||
int a = 255;
|
||||
int r = (hexchar2int(text[1]) << 4) | hexchar2int(text[2]);
|
||||
int g = (hexchar2int(text[3]) << 4) | hexchar2int(text[4]);
|
||||
int b = (hexchar2int(text[5]) << 4) | hexchar2int(text[6]);
|
||||
int r = (std::max(0, hexchar2int(text[1])) << 4) | hexchar2int(text[2]);
|
||||
int g = (std::max(0, hexchar2int(text[3])) << 4) | hexchar2int(text[4]);
|
||||
int b = (std::max(0, hexchar2int(text[5])) << 4) | hexchar2int(text[6]);
|
||||
if (text.length() == 9) {
|
||||
a = (hexchar2int(text[7]) << 4) | hexchar2int(text[8]);
|
||||
a = (std::max(0, hexchar2int(text[7])) << 4) | hexchar2int(text[8]);
|
||||
}
|
||||
return glm::vec4(r / 255.f, g / 255.f, b / 255.f, a / 255.f);
|
||||
} else {
|
||||
|
||||
Reference in New Issue
Block a user