Skip to content

Commit 2ebfa56

Browse files
committed
fix hsv color space tests
1 parent 0268c68 commit 2ebfa56

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

lib/Graphics/Toolkit/Color/Space/Instance/HSV.pm

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ my $hsv_def = Graphics::Toolkit::Color::Space->new( axis => [qw/hue saturation v
1515

1616

1717
sub from_rgb {
18-
my ($r, $g, $b) = @_;
18+
my ($r, $g, $b) = @{$_[0]};
1919
my $vmin = min($r, $g, $b);
2020
my $v = my $vmax = max($r, $g, $b);
2121
return (0, 0, $v) if $vmax == $vmin;
@@ -29,7 +29,7 @@ sub from_rgb {
2929
}
3030

3131
sub to_rgb {
32-
my ($h, $s, $v) = @_;
32+
my ($h, $s, $v) = @{$_[0]};
3333
return ($v, $v, $v) if $s == 0;
3434
my $hi = int( $h * 6 );
3535
my $f = ( $h * 6 ) - $hi;

t/14_hsv_space.t

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ my $def = eval "require $module";
1212
is( not($@), 1, 'could load the module');
1313
is( ref $def, 'Graphics::Toolkit::Color::Space', 'got tight return value by loading module');
1414
is( $def->name, 'HSV', 'color space has right name');
15-
is( $def->dimensions, 3, 'color space has 3 dimensions');
15+
is( $def->axis, 3, 'color space has 3 axis');
1616
is( ref $def->in_range([0, 0, 0]), 'ARRAY', 'check HSV values works on lower bound values');
1717
is( ref $def->in_range([360,100,100]), 'ARRAY', 'check HSV values works on upper bound values');
1818
is( ref $def->in_range([0,0]), '', "HSV got too few values");

0 commit comments

Comments
 (0)