Introduction of classes ColorRGB and ColorRGBA to unify color data definition and manipulation

(cherry picked from commit prusa3d/PrusaSlicer@d0bff2d996 )
This commit is contained in:
enricoturri1966 2023-10-20 15:41:26 +08:00 committed by Noisyfox
parent 36ffb18059
commit 28d0147d09
60 changed files with 1290 additions and 1174 deletions

View file

@ -2812,13 +2812,13 @@ int ObjectTablePanel::init_filaments_and_colors()
}
unsigned int i = 0;
unsigned char rgb[3];
ColorRGB rgb;
while (i < m_filaments_count) {
const std::string& txt_color = global_config->opt_string("filament_colour", i);
if (i < color_count) {
if (Slic3r::GUI::BitmapCache::parse_color(txt_color, rgb))
if (decode_color(txt_color, rgb))
{
m_filaments_colors[i] = wxColour(rgb[0], rgb[1], rgb[2]);
m_filaments_colors[i] = wxColour(rgb.r_uchar(), rgb.g_uchar(), rgb.b_uchar());
}
else
{