-
Notifications
You must be signed in to change notification settings - Fork 6
Open
Description
An array of colors can be empty when there are no colors in the image.
In the function max and min, you can not pass an empty array, otherwise the function will return false and throw warning.
Stacktrace:
Warning: max(): Array must contain at least one element
Exception trace:
() at vendor/marijnvdwerf/material-palette/src/ColorCutQuantizer.php:101
marijnvdwerf\palette\Vbox->getVolume() at vendor/marijnvdwerf/material-palette/src/ColorCutQuantizer.php:39
marijnvdwerf\palette\ColorCutQuantizer->quantize() at vendor/marijnvdwerf/material-palette/src/PaletteGenerator.php:47
marijnvdwerf\palette\PaletteGenerator->generate() at vendor/marijnvdwerf/material-palette/src/Palette.php:59
Sample code
$manager = new ImageManager();
$image = $manager->make('filename');
$palette = Palette::generate($image);
$palette->getVibrantSwatch()->getColor();Problem image
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels
