Skip to content

Commit 06add0a

Browse files
committed
fix hwb color space tests
1 parent 9f86d55 commit 06add0a

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

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

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

1616

1717
sub from_rgb {
18-
my ($r, $g, $b) = @_;
18+
my ($r, $g, $b) = @{$_[0]};
1919
my $vmax = max($r, $g, $b);
2020
my $white = my $vmin = min($r, $g, $b);
2121
my $black = 1 - ($vmax);
@@ -31,7 +31,7 @@ sub from_rgb {
3131

3232

3333
sub to_rgb {
34-
my ($h, $w, $b) = @_;
34+
my ($h, $w, $b) = @{$_[0]};
3535
return (0, 0, 0) if $b == 1;
3636
return (1, 1, 1) if $w == 1;
3737
my $v = 1 - $b;

t/16_hwb_space.t

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

0 commit comments

Comments
 (0)