Improve dynamic theme color performance for large images

This commit is contained in:
schroda
2025-03-25 23:42:39 +01:00
parent a23f6d02bf
commit d3f973e95b

View File

@@ -187,11 +187,13 @@ const Thumbnail = ({
img.src = Mangas.getThumbnailUrl(manga);
img.onload = () => {
const isLargeImage = img.width > 600 && img.height > 600;
Promise.all([
Vibrant.from(img).getPalette(),
new FastAverageColor().getColorAsync(img, {
new FastAverageColor().getColor(img, {
algorithm: 'dominant',
mode: 'precision',
mode: isLargeImage ? 'speed' : 'precision',
ignoredColor: [
[255, 255, 255, 255, 75],
[0, 0, 0, 255, 75],