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
This commit is contained in:
schroda
2025-03-25 02:28:18 +01:00
parent 6f8d5bb9dc
commit 15c11ded34

View File

@@ -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 ||