Skip to content

Commit

Permalink
Improve Looping
Browse files Browse the repository at this point in the history
  • Loading branch information
nikkanetiya committed Jul 9, 2017
1 parent a9a03fc commit 9212add
Showing 1 changed file with 3 additions and 5 deletions.
8 changes: 3 additions & 5 deletions src/ColorPaletteClient.php
Original file line number Diff line number Diff line change
Expand Up @@ -52,10 +52,8 @@ public function getPalette($sourceImage, $colorCount = 10, $quality = 10, $area

if(!$palette) return $palette;

foreach ($palette as $color) {
$data[] = new Color($color);
}

return $data;
return array_map(function ($value) {
return new Color($value);
}, $palette);
}
}

0 comments on commit 9212add

Please sign in to comment.