diff --git a/src/slic3r/GUI/GUI_Utils.hpp b/src/slic3r/GUI/GUI_Utils.hpp index 147f51970..10e2a6f94 100644 --- a/src/slic3r/GUI/GUI_Utils.hpp +++ b/src/slic3r/GUI/GUI_Utils.hpp @@ -52,6 +52,15 @@ static std::array 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; }