FIX: the insert custom gcode icon is not correct after sync ams
STUDIO-3053 Change-Id: Ia98f18481cba7fc080f7153d6da253403c5db494
This commit is contained in:
parent
b1bef0686b
commit
0162f5f75a
1 changed files with 9 additions and 0 deletions
|
@ -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;
|
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;
|
return ret;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue