Skip to content

Commit

Permalink
Merge branch 'pr551'
Browse files Browse the repository at this point in the history
  • Loading branch information
moggieuk committed Dec 14, 2024
2 parents aa655c0 + d563432 commit 5c40d8f
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions extras/mmu/mmu.py
Original file line number Diff line number Diff line change
Expand Up @@ -1065,7 +1065,7 @@ def _find_closest_color(self, ref_color, color_list):
weighted_euclidean_distance = lambda color1, color2, weights=(0.3, 0.59, 0.11): (
sum(weights[i] * (a - b) ** 2 for i, (a, b) in enumerate(zip(color1, color2)))
)
ref_rgb = self._color_to_rgb_tuple(ref_color, fraction=False)
ref_rgb = self._color_to_rgb_tuple(ref_color)
min_distance = float('inf')
closest_color = None
for color in color_list:
Expand Down Expand Up @@ -7171,16 +7171,16 @@ def _automap_gate(self, tool, strategy):
color_list = []
for gn, color in enumerate(search_in):
gm = "".join(self.gate_material[gn].strip()).replace('#', '').lower()
if gm == tool_to_remap['material']:
if gm == tool_to_remap['material'].lower():
color_list.append(color)
if not color_list:
errors.append("Gates with %s are mssing color information..." % tool_to_remap['material'])
errors.append("Gates with %s are missing color information..." % tool_to_remap['material'])

if not errors:
closest, distance = self._find_closest_color(tool_to_remap['color'], color_list)
for gn, color in enumerate(search_in):
gm = "".join(self.gate_material[gn].strip()).replace('#', '').lower()
if gm == tool_to_remap['material']:
if gm == tool_to_remap['material'].lower():
if closest == color:
t = self.console_gate_stat
if distance > 0.5:
Expand Down

0 comments on commit 5c40d8f

Please sign in to comment.