- the gradgen filter now does the same color value conversion that
authorTony Cook <tony@develop=help.com>
Sat, 1 Jan 2005 07:23:04 +0000 (07:23 +0000)
committerTony Cook <tony@develop=help.com>
Sat, 1 Jan 2005 07:23:04 +0000 (07:23 +0000)
  Imager's drawing functions do.

Changes
Imager.pm

diff --git a/Changes b/Changes
index 864f95ad3832cea4dce380acae9e95535a84aaa2..29112ae167b03c44ba4757647b4b387710a97d17 100644 (file)
--- a/Changes
+++ b/Changes
@@ -975,6 +975,8 @@ Revision history for Perl extension Imager.
 - add dfont to the list of extensions supported by ft2
 - document Imager::Font->new()'s index parameter
 - added concept index to Imager.pm's POD
+- the gradgen filter now does the same color value conversion that
+  Imager's drawing functions do.
 
 =================================================================
 
index 7b7c072479d8dd92e319967a9360f389331023a2..7eb179dbad345285e64af516f2ad012b97ca731b 100644 (file)
--- a/Imager.pm
+++ b/Imager.pm
@@ -221,11 +221,19 @@ BEGIN {
                       callsub => sub { my %hsh=@_; i_conv($hsh{image},$hsh{coef}); }
                      };
 
-  $filters{gradgen} ={
-                      callseq => ['image', 'xo', 'yo', 'colors', 'dist'],
-                      defaults => { },
-                      callsub => sub { my %hsh=@_; i_gradgen($hsh{image}, $hsh{xo}, $hsh{yo}, $hsh{colors}, $hsh{dist}); }
-                     };
+  $filters{gradgen} =
+    {
+     callseq => ['image', 'xo', 'yo', 'colors', 'dist'],
+     defaults => { dist => 0 },
+     callsub => 
+     sub { 
+       my %hsh=@_;
+       my @colors = @{$hsh{colors}};
+       $_ = _color($_)
+         for @colors;
+       i_gradgen($hsh{image}, $hsh{xo}, $hsh{yo}, \@colors, $hsh{dist});
+     }
+    };
 
   $filters{nearest_color} ={
                            callseq => ['image', 'xo', 'yo', 'colors', 'dist'],