Skip to content

Commit

Permalink
Fix undefined offset error (#54)
Browse files Browse the repository at this point in the history
  • Loading branch information
colinodell committed Sep 24, 2022
1 parent 552226f commit 21fcac6
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions src/Palette.php
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,10 @@ public function getIterator(): \Traversable
*/
public function getColorCount($color)
{
if (!array_key_exists($color, $this->colors)) {
return 0;
}

return $this->colors[$color];
}

Expand Down

0 comments on commit 21fcac6

Please sign in to comment.