FIX: the insert custom gcode icon is not correct after sync ams

STUDIO-3053

Change-Id: Ia98f18481cba7fc080f7153d6da253403c5db494
This commit is contained in:
zhimin.zeng 2023-06-05 15:02:15 +08:00 committed by Lane.Wei
parent b1bef0686b
commit 0162f5f75a

View file

@ -52,6 +52,15 @@ static std::array<float, 4> decode_color_to_float_array(const std::string color)
ret[j] = float(digit1 * 16 + digit2) / 255.0f;
}
}
else if (color.size() == 9 && color.front() == '#') {
for (size_t j = 0; j < 4; ++j) {
int digit1 = hex_to_int(*c++);
int digit2 = hex_to_int(*c++);
if (digit1 == -1 || digit2 == -1) break;
ret[j] = float(digit1 * 16 + digit2) / 255.0f;
}
}
return ret;
}