Skip to content

Commit

Permalink
fix hwb color space tests
Browse files Browse the repository at this point in the history
  • Loading branch information
lichtkind committed Apr 29, 2024
1 parent 9f86d55 commit 06add0a
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
4 changes: 2 additions & 2 deletions lib/Graphics/Toolkit/Color/Space/Instance/HWB.pm
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ my $hwb_def = Graphics::Toolkit::Color::Space->new( axis => [qw/hue whiteness bl


sub from_rgb {
my ($r, $g, $b) = @_;
my ($r, $g, $b) = @{$_[0]};
my $vmax = max($r, $g, $b);
my $white = my $vmin = min($r, $g, $b);
my $black = 1 - ($vmax);
Expand All @@ -31,7 +31,7 @@ sub from_rgb {


sub to_rgb {
my ($h, $w, $b) = @_;
my ($h, $w, $b) = @{$_[0]};
return (0, 0, 0) if $b == 1;
return (1, 1, 1) if $w == 1;
my $v = 1 - $b;
Expand Down
2 changes: 1 addition & 1 deletion t/16_hwb_space.t
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ use Graphics::Toolkit::Color::Space::Util ':all';
is( not($@), 1, 'could load the module');
is( ref $def, 'Graphics::Toolkit::Color::Space', 'got tight return value by loading module');
is( $def->name, 'HWB', 'color space has right name');
is( $def->dimensions, 3, 'color space has 3 dimensions');
is( $def->axis, 3, 'color space has 3 axis');
is( ref $def->in_range([0, 0, 0]), 'ARRAY', 'check HWB values works on lower bound values');
is( ref $def->in_range([360,100,100]), 'ARRAY', 'check HWB values works on upper bound values');
is( ref $def->in_range([0,0]), '', "HWB got too few values");
Expand Down

0 comments on commit 06add0a

Please sign in to comment.