use strict;
use vars qw($VERSION);
-$VERSION = "1.011";
+$VERSION = "1.012";
# It's just a front end to the XS creation functions.
@result = _hsv_to_rgb(@{$args{hsv}});
}
elsif ($args{channels}) {
- return @{$args{channels}};
+ my @ch = @{$args{channels}};
+ return ( @ch, (0) x (4 - @ch) );
}
elsif (exists $args{channel0} || $args{c0}) {
my $i = 0;
# Change 1..1 below to 1..last_test_to_print .
# (It may become useful if the test is moved to ./t subdirectory.)
-use Test::More tests => 70;
+use Test::More tests => 73;
use Imager;
use Imager::Test qw(is_fcolor4);
channel3=>134));
color_ok('c0-3', 129, 130, 131, 134,
Imager::Color->new(c0=>129, c1=>130, c2=>131, c3=>134));
-color_ok('channels arrayref', 200, 201, 203, 204,
+
+color_ok('channels arrayref (1)', 200, 0, 0, 0,
+ Imager::Color->new(channels=>[ 200, ]));
+color_ok('channels arrayref (2)', 200, 201, 0, 0,
+ Imager::Color->new(channels=>[ 200, 201 ]));
+color_ok('channels arrayref (3)', 200, 201, 203, 0,
+ Imager::Color->new(channels=>[ 200, 201, 203 ]));
+color_ok('channels arrayref (4)', 200, 201, 203, 204,
Imager::Color->new(channels=>[ 200, 201, 203, 204 ]));
+
color_ok('name', 255, 250, 250, 255,
Imager::Color->new(name=>'snow', palette=>'testimg/test_gimp_pal'));