public function getAdapter($adapterType) { $classname = "\\ColorThief\\Image\\Adapter\\" . $adapterType . "ImageAdapter"; return new $classname(); }