mirror of
https://github.com/OrcaSlicer/OrcaSlicer.git
synced 2026-07-24 19:32:18 +00:00
ENH:move get_extruders_colors api to plater class
jira: none Change-Id: I8c2b31d4963b01cb193b7f2a2a3650cf7252ebc5 (cherry picked from commit 3eeabc0722027b789c59130762bd57c2745cf188)
This commit is contained in:
@@ -14249,6 +14249,24 @@ void Plater::on_filaments_delete(size_t num_filaments, size_t filament_id, int r
|
||||
}
|
||||
}
|
||||
|
||||
std::vector<Slic3r::ColorRGBA> Plater::get_extruders_colors()
|
||||
{
|
||||
unsigned char rgba_color[4] = {};
|
||||
std::vector<std::string> colors = get_extruder_colors_from_plater_config();
|
||||
std::vector<Slic3r::ColorRGBA> colors_out(colors.size());
|
||||
for (const std::string &color : colors) {
|
||||
Slic3r::GUI::BitmapCache::parse_color4(color, rgba_color);
|
||||
size_t color_idx = &color - &colors.front();
|
||||
colors_out[color_idx] = {
|
||||
float(rgba_color[0]) / 255.f,
|
||||
float(rgba_color[1]) / 255.f,
|
||||
float(rgba_color[2]) / 255.f,
|
||||
float(rgba_color[3]) / 255.f,
|
||||
};
|
||||
}
|
||||
return colors_out;
|
||||
}
|
||||
|
||||
void Plater::on_bed_type_change(BedType bed_type)
|
||||
{
|
||||
sidebar().on_bed_type_change(bed_type);
|
||||
|
||||
Reference in New Issue
Block a user