Skip to main content

media: ensure tint colours never have ANSI escape codes

ID
9e34ade
date
2026-05-05 08:09:24+00:00
author
Alex Chan <alex@alexwlchan.net>
parent
751b5a6
message
media: ensure tint colours never have ANSI escape codes
changed files
1 file, 8 additions, 3 deletions

Changed files

src/chives/media.py (10515) → src/chives/media.py (10573)

diff --git a/src/chives/media.py b/src/chives/media.py
index 196488a..5243cd2 100644
--- a/src/chives/media.py
+++ b/src/chives/media.py
@@ -313,9 +313,14 @@ def get_tint_colour(path: str | Path, *, background: str) -> str:
     elif background == "black":
         background = "#000000"
 
-    result = subprocess.check_output(
-        ["dominant_colours", str(path), "--best-against-bg", background], text=True
-    )
+    cmd = [
+        "dominant_colours",
+        str(path),
+        f"--best-against-bg={background}",
+        "--no-palette",
+    ]
+
+    result = subprocess.check_output(cmd, text=True)
     return result.strip()