Match exclusion accent in light mode

Use the stats highlight colour for exclusion outlines in light theme, keeping the gold highlight for dark mode.
This commit is contained in:
lm 2025-10-17 17:23:49 +02:00
parent f9e2dd84c3
commit 4fc0182798
1 changed files with 10 additions and 4 deletions

View File

@ -262,16 +262,19 @@ class ImageProcessingMixin:
draw.point((x, y), fill=(255, 0, 0, alpha))
merged = Image.alpha_composite(base, overlay)
outline = ImageDraw.Draw(merged)
accent_dark = (255, 215, 0, 200)
accent_light = (197, 98, 23, 200)
accent = accent_dark if getattr(self, "theme", "light") == "dark" else accent_light
for shape in getattr(self, "exclude_shapes", []):
if shape.get("kind") == "rect":
x0, y0, x1, y1 = shape["coords"] # type: ignore[index]
outline.rectangle([x0, y0, x1, y1], outline=(255, 215, 0, 200), width=3)
outline.rectangle([x0, y0, x1, y1], outline=accent, width=3)
elif shape.get("kind") == "polygon":
points = shape.get("points", [])
if len(points) < 2:
continue
path = points if points[0] == points[-1] else points + [points[0]]
outline.line(path, fill=(255, 215, 0, 200), width=2, joint="round")
outline.line(path, fill=accent, width=2, joint="round")
return merged
def compute_stats_preview(self):
@ -439,12 +442,15 @@ class ImageProcessingMixin:
except Exception:
pass
self._exclude_canvas_ids = []
accent_dark = "#ffd700"
accent_light = "#c56217"
accent = accent_dark if getattr(self, "theme", "light") == "dark" else accent_light
for shape in getattr(self, "exclude_shapes", []):
kind = shape.get("kind")
if kind == "rect":
x0, y0, x1, y1 = shape["coords"] # type: ignore[index]
item = self.canvas_orig.create_rectangle(
x0, y0, x1, y1, outline="yellow", width=3
x0, y0, x1, y1, outline=accent, width=3
)
self._exclude_canvas_ids.append(item)
elif kind == "polygon":
@ -455,7 +461,7 @@ class ImageProcessingMixin:
coords = [coord for point in closed for coord in point] # type: ignore[misc]
item = self.canvas_orig.create_line(
*coords,
fill="yellow",
fill=accent,
width=2,
smooth=True,
capstyle="round",