From 15c11ded346c53cedfe6f90b245172aa7f87e0d4 Mon Sep 17 00:00:00 2001 From: schroda <50052685+schroda@users.noreply.github.com> Date: Tue, 25 Mar 2025 02:28:18 +0100 Subject: [PATCH] Tweak dynamic theme dominant color detection Currently, a lot of manga have the same whit/black-ish background color, which results of the thumbnails containing a lot of white/black colors. These changes improve this a little - reduce impact of white and black colors - use "precision" mode of algorithm --- src/modules/manga/components/MangaDetails.tsx | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/src/modules/manga/components/MangaDetails.tsx b/src/modules/manga/components/MangaDetails.tsx index 0b1e3130..ccc9dbed 100644 --- a/src/modules/manga/components/MangaDetails.tsx +++ b/src/modules/manga/components/MangaDetails.tsx @@ -189,7 +189,14 @@ const Thumbnail = ({ img.onload = () => { Promise.all([ Vibrant.from(img).getPalette(), - new FastAverageColor().getColorAsync(img, { algorithm: 'dominant' }), + new FastAverageColor().getColorAsync(img, { + algorithm: 'dominant', + mode: 'precision', + ignoredColor: [ + [255, 255, 255, 255, 75], + [0, 0, 0, 255, 75], + ], + }), ]).then(([palette, averageColor]) => { if ( !palette.Vibrant ||