summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--lib/Games/NES/SpriteMaker.pm3
1 files changed, 2 insertions, 1 deletions
diff --git a/lib/Games/NES/SpriteMaker.pm b/lib/Games/NES/SpriteMaker.pm
index 4647303..c6a69bd 100644
--- a/lib/Games/NES/SpriteMaker.pm
+++ b/lib/Games/NES/SpriteMaker.pm
@@ -85,7 +85,8 @@ sub image_to_sprite {
sub _get_palette_colors {
my ($image) = @_;
- my %unique_values = ("1;1;1" => 0);
+ my $max = $image->max_pixel_value;
+ my %unique_values = ("$max;$max;$max" => 0);
my $idx = 1;
for my $row (0..$image->height - 1) {
for my $col (0..$image->width - 1) {