mirror of
https://github.com/SoftFever/OrcaSlicer.git
synced 2025-07-07 23:17:35 -06:00
FIX: color is not correct after sync ams
Change-Id: Ib681f84c3b2d8267fa832072a32d1f49c21145fd
This commit is contained in:
parent
c351ac54aa
commit
65ea350f01
2 changed files with 18 additions and 0 deletions
|
@ -103,6 +103,16 @@ static std::array<float, 4> decode_color(const std::string& color) {
|
|||
ret[j] = float(digit1 * 16 + digit2) * INV_255;
|
||||
}
|
||||
}
|
||||
else if (color.size() == 9 && color.front() == '#') {
|
||||
for (size_t j = 0; j < 4; ++j) {
|
||||
int digit1 = hex_digit_to_int(*c++);
|
||||
int digit2 = hex_digit_to_int(*c++);
|
||||
if (digit1 == -1 || digit2 == -1)
|
||||
break;
|
||||
|
||||
ret[j] = float(digit1 * 16 + digit2) * INV_255;
|
||||
}
|
||||
}
|
||||
return ret;
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue