Skip to content

Commit

Permalink
fix: image placeholder color
Browse files Browse the repository at this point in the history
  • Loading branch information
ArnaudLigny committed Jan 5, 2025
1 parent 28215c5 commit ee5a907
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 7 deletions.
12 changes: 6 additions & 6 deletions composer.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion src/Assets/Image.php
Original file line number Diff line number Diff line change
Expand Up @@ -116,7 +116,7 @@ public static function getDominantColor(Asset $asset): string
$assetColor = $assetColor->resize(100);
$image = self::manager()->read($assetColor['content']);

return $image->pickColor(0, 0)->toString();
return $image->reduceColors(1)->pickColor(0, 0)->toString();
} catch (\Exception $e) {
throw new RuntimeException(\sprintf('Can\'t get dominant color of "%s": %s', $asset['path'], $e->getMessage()));
}
Expand Down

0 comments on commit ee5a907

Please sign in to comment.