diff --git a/app/Helpers/HelperFunctions.php b/app/Helpers/HelperFunctions.php index 2cee892..7db6d3f 100644 --- a/app/Helpers/HelperFunctions.php +++ b/app/Helpers/HelperFunctions.php @@ -1,6 +1,7 @@ read(file_get_contents($imageUrl)); $img->resize(24, 24); @@ -31,9 +34,9 @@ function getAverageColorFromImageUrl($imageUrl): string for ($x = 0; $x < $width; $x++) { for ($y = 0; $y < $height; $y++) { $color = $img->pickColor($x, $y); - $totalR += $color[0]; - $totalG += $color[1]; - $totalB += $color[2]; + $totalR += $color->red()->toInt(); + $totalG += $color->green()->toInt(); + $totalB += $color->blue()->toInt(); } }