protected function compareGreyBlock(Block $_a, Block $_b) { $colorA = $_a->getAverageColor(); $colorB = $_b->getAverageColor(); return $_a->getSize() * abs($colorA->getGrey() - $colorB->getGrey()); }