public function getDominantColor($image, $quality, $colorValue)
    {
        try {
            $source = new LocalSourceImageModel($image);
            $source->getLocalCopy();
        } catch (ImagerException $e) {
            return null;
        }

        $dominantColor = ColorThief::getColor($source->getFilePath(), $quality);

        ImagerService::cleanSession();

        if (!\is_array($dominantColor)) {
            return null;
        }

        return $colorValue === 'hex' ? self::rgb2hex($dominantColor) : $dominantColor;
    }
public function getDominantColor($image, $quality, $colorValue)
    {
        try {
            $source = new LocalSourceImageModel($image);
            $source->getLocalCopy();
        } catch (ImagerException $e) {
            return null;
        }

        $dominantColor = ColorThief::getColor($source->getFilePath(), $quality);

        ImagerService::cleanSession();

        if (!\is_array($dominantColor)) {
            return null;
        }

        return $colorValue === 'hex' ? self::rgb2hex($dominantColor) : $dominantColor;
    }
public function getDominantColor ( $ image , $ quality , $ colorValue ) { try { $ source = new LocalSourceImageModel ( $ image ) ; $ source -> getLocalCopy ( ) ; } catch ( ImagerException $ e ) { return null ; } $ dominantColor = ColorThief :: getColor ( $ source -> getFilePath ( ) , $ quality ) ; ImagerService :: cleanSession ( ) ; if ( ! \ is_array ( $ dominantColor ) ) { return null ; } return $ colorValue === 'hex' ? self :: rgb2hex ( $ dominantColor ) : $ dominantColor ; }
Get dominant color of image

@param Asset|string $image
@param int $quality
@param string $colorValue

@return string|array|boolean|null
Get dominant color of image