Skip to content

Commit d9f830f

Browse files
committed
fixed RGB tests
1 parent 124ec9d commit d9f830f

File tree

12 files changed

+102
-98
lines changed

12 files changed

+102
-98
lines changed

lib/Graphics/Toolkit/Color/Space.pm

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ sub new {
2424

2525
sub basis { $_[0]{'basis'} }
2626
sub name { $_[0]->basis->space_name } # --> ~
27-
sub dimensions { $_[0]->basis->count } # --> +
27+
sub axis { $_[0]->basis->count } # --> +
2828
sub is_value_tuple { $_[0]->basis->is_value_tuple( $_[1] ) } # @+values --> ?
2929

3030
########################################################################
@@ -40,10 +40,11 @@ sub delta { shift->shape->delta( @_ ) } # @+values1, @+valu
4040
########################################################################
4141

4242
sub form { $_[0]{'format'} }
43-
sub add_formatter { shift->form->add_formatter(@_) } # ~format_name, &formatter --> &|
44-
sub add_deformatter { shift->form->add_deformatter(@_) } # ~format_name, &deformatter --> &|
4543
sub format { shift->form->format(@_) } # @+values, ~format_name -- @~suffix --> $*color
46-
sub deformat { shift->form->deformat(@_) } # $*color-- @~suffix --> @+values
44+
sub deformat { shift->form->deformat(@_) } # $*color -- @~suffix --> @+values, ~format_name
45+
sub has_format { shift->form->has_format(@_) } # ~format_name --> ?
46+
sub add_formatter { shift->form->add_formatter(@_) } # ~format_name, &formatter --> &?
47+
sub add_deformatter { shift->form->add_deformatter(@_) } # ~format_name, &deformatter --> &?
4748

4849
#### conversion ########################################################
4950

lib/Graphics/Toolkit/Color/Space/Format.pm

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -24,15 +24,15 @@ sub new {
2424
# format --> tuple
2525
my %deformats = ( hash => sub { tuple_from_hash(@_) },
2626
named_array => sub { tuple_from_named_array(@_) },
27-
string => sub { tuple_from_named_string(@_) },
27+
named_string => sub { tuple_from_named_string(@_) },
2828
css_string => sub { tuple_from_css_string(@_) },
2929
);
3030
# tuple --> format
3131
my %formats = (list => sub { @{$_[1]} }, # 1, 2, 3
3232
hash => sub { $basis->long_hash_from_tuple($_[1]) }, # { red => 1, green => 2, blue => 3 }
3333
char_hash => sub { $basis->short_hash_from_tuple($_[1]) }, # { r =>1, g => 2, b => 3 }
34-
array => sub { [$basis->space_name, @{$_[1]}] }, # ['rgb',1,2,3]
35-
string => sub { $_[0]->named_string_from_tuple($_[1]) }, # 'rgb: 1, 2, 3'
34+
named_array => sub { [$basis->space_name, @{$_[1]}] }, # ['rgb',1,2,3]
35+
named_string => sub { $_[0]->named_string_from_tuple($_[1]) }, # 'rgb: 1, 2, 3'
3636
css_string => sub { $_[0]->css_string_from_tuple($_[1]) }, # 'rgb(1,2,3)'
3737
);
3838
bless { basis => $basis, suffix => $suffix, value_format => $value_format ,

lib/Graphics/Toolkit/Color/Space/Hub.pm

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ use warnings;
66
package Graphics::Toolkit::Color::Space::Hub;
77
use Carp;
88
our $base_package = 'RGB';
9-
my @space_packages = ($base_package, qw/CMY CMYK HSL HSV HSB HWB YIQ XYZ LAB LUV LCHab LCHuv/); # search order ## missing: Ncol
9+
my @space_packages = ($base_package, qw/CMY CMYK HSL HSV HSB HWB YIQ XYZ LAB LUV LCHab LCHuv NCol/); # search order ## missing: Ncol
1010
my %space_obj = map { $_ => require "Graphics/Toolkit/Color/Space/Instance/$_.pm" } @space_packages; # outer names
1111
my %space_lookup = map { $_->name => $_ } values %space_obj; # full color space names
1212

@@ -273,15 +273,15 @@ color space.
273273
274274
(10, 20, 30)
275275
276-
=head2 string
276+
=head2 named_string
277277
278278
'RGB: 10, 20, 30'
279279
280280
=head2 css_string
281281
282282
'rgb(10, 20, 30)'
283283
284-
=head2 array
284+
=head2 named_array
285285
286286
[RGB => 10, 20, 30]
287287

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

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,8 +7,9 @@ package Graphics::Toolkit::Color::Space::Instance::NCol;
77
use Graphics::Toolkit::Color::Space::Util ':all';
88
use Graphics::Toolkit::Color::Space;
99

10-
my $hsl_def = Graphics::Toolkit::Color::Space->new( axis => [qw/hue whiteness blackness/],
11-
range => [ 360, 100, 100 ], precision => 0
10+
my $hsl_def = Graphics::Toolkit::Color::Space->new( name => 'NCol',
11+
axis => [qw/hue whiteness blackness/],
12+
range => [ 360, 100, 100], precision => 0
1213
suffix => ['', '%', '%'],
1314
type => [qw/no linear linear/],
1415
);

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

Lines changed: 9 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -8,21 +8,22 @@ use Graphics::Toolkit::Color::Space;
88
use Graphics::Toolkit::Color::Space::Util ':all';
99

1010
my $rgb_def = Graphics::Toolkit::Color::Space->new( axis => [qw/red green blue/], range => 255 );
11-
$rgb_def->add_formatter( 'hex', \&hex_from_rgb );
12-
$rgb_def->add_deformatter( 'hex', \&rgb_from_hex );
11+
$rgb_def->add_formatter( 'hex_string', \&hex_from_rgb );
12+
$rgb_def->add_deformatter( 'hex_string', \&rgb_from_hex );
1313
$rgb_def->add_deformatter( 'array', sub { $_[1] if $rgb_def->is_value_tuple( $_[1] ) } );
1414

1515

16-
sub hex_from_rgb { return unless @_ == $rgb_def->dimensions; sprintf "#%02x%02x%02x", @_ }
16+
sub hex_from_rgb { sprintf("#%02x%02x%02x", @{$_[1]} ) }
1717

1818
sub rgb_from_hex { # translate #000000 and #000 --> r, g, b
19-
my $hex = shift;
19+
my ($self, $hex) = @_;
2020
return "hex color definition '$hex' has to start with # followed by 3 or 6 hex characters (0-9,a-f)"
21-
unless defined $hex and (length($hex) == 4 or length($hex) == 7)
22-
and substr($hex, 0, 1) eq '#' and $hex =~ /^#[\da-f]+$/i;
21+
unless defined $hex and not ref $hex
22+
and (length($hex) == 4 or length($hex) == 7)
23+
and substr($hex, 0, 1) eq '#' and $hex =~ /^#[\da-f]+$/i;
2324
$hex = substr $hex, 1;
24-
(length $hex == 3) ? (map { hex($_.$_) } unpack( "a1 a1 a1", $hex))
25-
: (map { hex($_ ) } unpack( "a2 a2 a2", $hex));
25+
[(length $hex == 3) ? (map { hex($_.$_) } unpack( "a1 a1 a1", $hex))
26+
: (map { hex($_ ) } unpack( "a2 a2 a2", $hex))];
2627
}
2728

2829
# defined $_[0] and ($_[0] =~ /^#[[:xdigit:]]{3}$/ or $_[0] =~ /^#[[:xdigit:]]{6}$/)

lib/Graphics/Toolkit/Color/Space/Shape.pm

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -160,9 +160,10 @@ sub denormalize {
160160
return unless $self->basis->is_value_tuple( $values );
161161
$range = $self->_range( $range );
162162
return "bad range definition" unless ref $range;
163+
163164
my @val = map { ($self->axis_is_numeric( $_ )) ? ($values->[$_] * ($range->[$_][1]-$range->[$_][0]) + $range->[$_][0])
164165
: $values->[$_] } $self->basis->iterator;
165-
return \@val;
166+
return $self->round( \@val, $precision );
166167
}
167168

168169
sub denormalize_delta {

t/02_space_basis.t

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,8 +7,7 @@ use Test::More tests => 117;
77
BEGIN { unshift @INC, 'lib', '../lib'}
88
my $module = 'Graphics::Toolkit::Color::Space::Basis';
99

10-
eval "use $module";
11-
is( not($@), 1, 'could load the module');
10+
use_ok( $module, 'could load the module');
1211

1312
my $obj = Graphics::Toolkit::Color::Space::Basis->new();
1413
like( $obj, qr/first argument/, 'constructor needs arguments');

t/03_space_shape.t

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,10 +6,8 @@ use Test::More tests => 116;
66

77
BEGIN { unshift @INC, 'lib', '../lib'}
88
my $module = 'Graphics::Toolkit::Color::Space::Shape';
9-
eval "use $module;";
10-
is( not($@), 1, 'could load the module');
11-
129

10+
use_ok( $module, 'could load the module');
1311
my $obj = Graphics::Toolkit::Color::Space::Shape->new();
1412
is( $obj, undef, 'constructor needs arguments');
1513

t/04_space_format.t

Lines changed: 5 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -27,19 +27,19 @@ is( @$vals, 3, 'right amount of values');
2727
is( $vals->[0], 0, 'first value');
2828
is( $vals->[1], 2.2, 'secong value');
2929
is( $vals->[2], -3, 'third value');
30-
is( $name, 'string', 'found right format name');
30+
is( $name, 'named_string', 'found right format name');
3131

3232
($vals, $name) = $pobj->deformat('abg:1%,2%,3%');
3333
is( ref $vals, 'ARRAY', 'could deformat values with suffix');
3434
is( @$vals, 3, 'right amount of values');
3535
is( $vals->[0], 1, 'first value');
3636
is( $vals->[1], 2, 'second value');
3737
is( $vals->[2], 3, 'third value');
38-
is( $name, 'string', 'found right format name');
38+
is( $name, 'named_string', 'found right format name');
3939

4040
($vals, $name) = $pobj->deformat(' abg: 1 %, 2 % , 3% ');
4141
is( ref $vals, 'ARRAY', 'ignored inserted spaces in named string');
42-
is( $name, 'string', 'recognized named string format');
42+
is( $name, 'named_string', 'recognized named string format');
4343

4444

4545
($vals, $name) = $pobj->deformat(' abg( 1 %, 2 % , 3% ) ');
@@ -129,15 +129,15 @@ is( $hash->{'a'}, 0, 'first value');
129129
is( $hash->{'b'}, 2.2, 'second value');
130130
is( $hash->{'g'}, -3, 'third value');
131131

132-
my $array = $obj->format( [0,2.2,-3], 'array');
132+
my $array = $obj->format( [0,2.2,-3], 'named_array');
133133
is( ref $array, 'ARRAY', 'could format into HASH with character keys');
134134
is( int@$array, 4, 'right amount of elements');
135135
is( $array->[0], 'ABG', 'first value is color space name');
136136
is( $array->[1], 0, 'first numerical value');
137137
is( $array->[2], 2.2, 'second numerical value');
138138
is( $array->[3], -3, 'third numerical value');
139139

140-
my $string = $obj->format( [0,2.2,-3], 'string');
140+
my $string = $obj->format( [0,2.2,-3], 'named_string');
141141
is( ref $string, '', 'could format into string');
142142
is( $string, 'abg: 0, 2.2, -3', 'string syntax ist correct');
143143

@@ -177,24 +177,3 @@ is( $vals->[1], 2.2, 'second value');
177177
is( $vals->[2], -3, 'third value');
178178

179179
exit 0;
180-
181-
__END__
182-
183-
184-
$rgb_def->add_formatter( 'hex', \&hex_from_rgb );
185-
$rgb_def->add_deformatter( 'hex', sub { rgb_from_hex(@_) if is_hex(@_) } );
186-
$rgb_def->add_deformatter( 'array', sub { $_[1] if $rgb_def->is_value_tuple( $_[1] ) } );
187-
188-
189-
sub hex_from_rgb { return unless @_ == $rgb_def->dimensions; sprintf "#%02x%02x%02x", @_ }
190-
191-
sub rgb_from_hex { # translate #000000 and #000 --> r, g, b
192-
my $hex = shift;
193-
return carp "hex color definition '$hex' has to start with # followed by 3 or 6 hex characters (0-9,a-f)"
194-
unless defined $hex and (length($hex) == 4 or length($hex) == 7) and $hex =~ /^#[\da-f]+$/i;
195-
$hex = substr $hex, 1;
196-
(length $hex == 3) ? (map { CORE::hex($_.$_) } unpack( "a1 a1 a1", $hex))
197-
: (map { CORE::hex($_ ) } unpack( "a2 a2 a2", $hex));
198-
}
199-
200-
sub is_hex { defined $_[0] and ($_[0] =~ /^#[[:xdigit:]]{3}$/ or $_[0] =~ /^#[[:xdigit:]]{6}$/)}

t/05_space.t

Lines changed: 17 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -7,11 +7,24 @@ use Test::More tests => 67;
77
BEGIN { unshift @INC, 'lib', '../lib'}
88
my $module = 'Graphics::Toolkit::Color::Space';
99

10-
eval "use $module";
11-
is( not($@), 1, 'could load the module');
12-
10+
use_ok( $module, 'could load the module');
1311
my $fspace = Graphics::Toolkit::Color::Space->new();
14-
is( ref $fspace, '', 'need vector names to create color space');
12+
is( ref $fspace, '', 'need axis names to create color space');
13+
14+
my $space = Graphics::Toolkit::Color::Space->new(axis => [qw/AAA BBB CCC DDD/]);
15+
is( ref $space, $module, 'got axis names and created color space');
16+
is( $space->name, 'ABCD', 'got space name from AXIS short names');
17+
is( $space->axis, 4, 'counted axis right');
18+
is( $space->is_value_tuple([1,2,3,4]), 1, 'correct value tuple');
19+
is( $space->is_value_tuple([1,2,3,4,5]), 0, 'too long value tuple');
20+
is( $space->is_value_tuple([1,2,3,]), 0, 'too short value tuple');
21+
is( $space->is_value_tuple({1=>1,2=>2,3=>3,4=>4,}), 0, 'wrong ref type for value tuple');
22+
is( $space->is_value_tuple(''), 0, 'no ref type can not be value tuple');
23+
24+
25+
exit 0;
26+
27+
__END__
1528
my $space = Graphics::Toolkit::Color::Space->new(axis => [qw/AAA BBB CCC DDD/], range => 20);
1629
1730
is( ref $space, $module, 'could create a space object');

t/10_rgb_space.t

Lines changed: 52 additions & 41 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
use v5.12;
44
use warnings;
5-
use Test::More tests => 82;
5+
use Test::More tests => 93;
66

77
BEGIN { unshift @INC, 'lib', '../lib'}
88
my $module = 'Graphics::Toolkit::Color::Space::Instance::RGB';
@@ -11,7 +11,7 @@ my $def = eval "require $module";
1111
is( not($@), 1, 'could load the module');
1212
is( ref $def, 'Graphics::Toolkit::Color::Space', 'got right return value by loading module');
1313
is( $def->name, 'RGB', 'color space has right name');
14-
is( $def->dimensions, 3, 'color space has 3 dimensions');
14+
is( $def->axis, 3, 'color space has 3 axis');
1515

1616
is( ref $def->in_range([0,0,0]), 'ARRAY', 'check RGB values works on lower bound values');
1717
is( ref $def->in_range([255,255,255]), 'ARRAY', 'check RGB values works on upper bound values');
@@ -51,84 +51,95 @@ is( $rgb->[0], 0, 'too low red value is clamp up');
5151
is( $rgb->[1], 10, 'in range green value is not touched');
5252
is( $rgb->[2], 255, 'too large blue value is clamp down');
5353

54-
is( $def->format([0,0,0], 'hex'), '#000000', 'converted black from rgb to hex');
55-
is( uc $def->format([255,255,255],'HEX'), '#FFFFFF', 'converted white from rgb to hex');
56-
is( uc $def->format([ 10, 20, 30],'hex'), '#0A141E', 'converted random color from rgb to hex');
57-
58-
$rgb = $def->deformat('#332200');
59-
is( @$rgb, 3, 'could deformat hex string');
60-
is( $rgb->[0], 51, 'red is correctly tranlated from hex');
61-
is( $rgb->[1], 34, 'green is correctly tranlated from hex');
62-
is( $rgb->[2], 0, 'blue is correctly tranlated from hex');
63-
64-
$rgb = $def->deformat('#DEF');
65-
is( int @$rgb, 3, 'could deformat short hex string');
66-
is( $rgb->[0], 221, 'converted (short form) hex to RGB red is correct');
67-
is( $rgb->[1], 238, 'converted (short form) hex to RGB green is correct');
68-
is( $rgb->[2], 255, 'converted (short form) hex to RGB blue is correct');
69-
70-
$rgb = $def->deformat([ 33, 44, 55]);
71-
is( int @$rgb, 3, 'number triplet in ARRAY is recognized by ARRAY');
54+
is( $def->format([0,0,0], 'hex_string'), '#000000', 'converted black from rgb to hex');
55+
is( uc $def->format([255,255,255],'HEX_string'), '#FFFFFF', 'converted white from rgb to hex');
56+
is( uc $def->format([ 10, 20, 30],'hex_strinG'), '#0A141E', 'converted random color from rgb to hex');
57+
58+
my ($vals, $name) = $def->deformat('#332200');
59+
is( ref $vals, 'ARRAY', 'could deformat hex string');
60+
is( $name, 'hex_string', 'could deformat hex string');
61+
is( @$vals, 3, 'right amount of values');
62+
is( $vals->[0], 51, 'red is correctly tranlated from hex');
63+
is( $vals->[1], 34, 'green is correctly tranlated from hex');
64+
is( $vals->[2], 0, 'blue is correctly tranlated from hex');
65+
66+
($rgb, $name) = $def->deformat('#DEF');
67+
is( ref $rgb, 'ARRAY', 'could deformat short hex string');
68+
is( int @$rgb, 3, 'right amount of values');
69+
is( $name, 'hex_string', 'could deformat hex string');
70+
is( $rgb->[0], 221, 'converted (short form) hex to RGB red is correct');
71+
is( $rgb->[1], 238, 'converted (short form) hex to RGB green is correct');
72+
is( $rgb->[2], 255, 'converted (short form) hex to RGB blue is correct');
73+
74+
($rgb, $name) = $def->deformat([ 33, 44, 55]);
75+
is( $name, 'array', 'could deformat ARRAY ref (RGB special)');
76+
is( ref $rgb, 'ARRAY', 'got value tuple');
77+
is( int @$rgb, 3, 'number triplet in ARRAY is recognized by ARRAY');
7278
is( $rgb->[0], 33, 'red is transported');
7379
is( $rgb->[1], 44, 'green is transported');
7480
is( $rgb->[2], 55, 'blue is transported');
7581

76-
$rgb = $def->deformat([rgb => 11, 22, 256]);
77-
is( int @$rgb, 3, 'deformat lc named ARRAY: got 3 values');
82+
($rgb, $name) = $def->deformat([rgb => 11, 22, 256]);
83+
is( $name, 'named_array', 'could deformat named array');
84+
is( ref $rgb, 'ARRAY', 'deformat lc named ARRAY');
85+
is( int @$rgb, 3, 'got 3 values');
7886
is( $rgb->[0], 11, 'red is correct');
7987
is( $rgb->[1], 22, 'green got transported');
8088
is( $rgb->[2], 256, 'blue value does not get clamped');
8189

8290
$rgb = $def->deformat(['CMY', 11, 22, 33]);
8391
is( $rgb->[0], undef, 'OO deformat reacts only to right name');
8492

85-
$rgb = $def->deformat('RGB: -1, 256, 3.3 ');
93+
($rgb, $name) = $def->deformat('RGB: -1, 256, 3.3 ');
94+
is( $name, 'named_string', 'could deformat named string');
8695
is( int @$rgb, 3, 'deformat STRING format: got 3 values');
8796
is( $rgb->[0], -1, 'to small red is not clamped up');
8897
is( $rgb->[1], 256, 'too large green is not clamped down');
8998
is( $rgb->[2], 3.3, 'blue decimals do not get clamped');
9099

91100

92-
93-
$rgb = $def->deformat('rgb:0,1,2');
101+
($rgb, $name) = $def->deformat('rgb:0,1,2');
102+
is( $name, 'named_string', 'could deformat named string without spaces');
94103
is( int @$rgb, 3, 'deformat STRING format without spaces and lc name: got 3 values');
95-
is( $rgb->[0], 0, 'red is zero');
96-
is( $rgb->[1], 1, 'green is one');
97-
is( $rgb->[2], 2, 'blue is two');
104+
is( $rgb->[0], 0, 'red is zero');
105+
is( $rgb->[1], 1, 'green is one');
106+
is( $rgb->[2], 2, 'blue is two');
98107

99108
$rgb = $def->deformat('cmy: 1,2,3.3');
100109
is( $rgb->[0], undef, 'OO deformat STRING reacts only to right space name');
110+
is( $def->format([0,256,3.3], 'named_string'), 'rgb: 0, 256, 3.3', 'formated rgb triplet into value string');
101111

102-
is( $def->format([0,256,3.3], 'string'), 'rgb: 0, 256, 3.3', 'formated rgb triplet into value string');
103112

104-
$rgb = $def->deformat('rgb( -1 , 2.3, 4444)');
105-
is( int @$rgb, 3, 'deformat css STRING formatwith all hurdles: got 3 values');
106-
is( $rgb->[0], -1, 'red is -1');
113+
($rgb, $name) = $def->deformat('rgb( -1 , 2.3, 4444)');
114+
is( $name, 'css_string', 'could deformat css string');
115+
is( int @$rgb, 3, 'got 3 values');
116+
is( $rgb->[0], -1, 'red is -1');
107117
is( $rgb->[1], 2.3, 'green is one');
108118
is( $rgb->[2], 4444, 'blue is two');
109119

110120
is( $def->format([-1,2.3,4444], 'css_string'), 'rgb(-1,2.3,4444)', 'formated rgb triplet into css string');
111121

112-
$rgb = $def->format([0,256,3.3], 'array');
113-
is( ref $rgb, 'ARRAY', 'formated into ARRAY');
122+
$rgb = $def->format([0,256,3.3], 'named_array');
123+
is( ref $rgb, 'ARRAY', 'formated into named ARRAY');
114124
is( @$rgb, 4, 'named RGB tuple has 4 elements');
115-
is( $rgb->[0], 'rgb', 'tuple color name space');
116-
is( $rgb->[1], 0, 'red in minimal');
117-
is( $rgb->[2], 256, 'green is too large');
118-
is( $rgb->[3], 3.3, 'blue still has decimal');
125+
is( $rgb->[0], 'RGB', 'tuple color name space');
126+
is( $rgb->[1], 0, 'red in minimal');
127+
is( $rgb->[2], 256, 'green is too large');
128+
is( $rgb->[3], 3.3, 'blue still has decimal');
119129

120-
is( $def->format([10,20,30], 'hex'), '#0a141e', 'formated rgb triplet into hex string');
130+
is( $def->format([10,20,30], 'hex_string'), '#0a141e', 'formated rgb triplet into hex string');
121131

122132
my $d = $def->delta([0,44,256],[256,88,0]);
123133
is( int @$d, 3, 'delta vector has right length');
124134
is( $d->[0], 256, 'delta in R component');
125135
is( $d->[1], 44, 'delta in G component');
126136
is( $d->[2], -256, 'delta in B component');
127137

128-
$rgb = $def->denormalize( [0.3, 0.4, 0.5], [[0,255],[0,255],[0,255]] );
129-
is( int @$rgb, 3, 'denormalized triplet');
138+
$rgb = $def->denormalize( [0.3, 0.4, 0.5], 255, 0 );
139+
is( int @$rgb, 3, 'denormalized triplet, got 3 values');
130140
is( $rgb->[0], 77, 'right red value');
131141
is( $rgb->[1], 102, 'right green value');
132142
is( $rgb->[2], 128, 'right blue value');
143+
exit 0;
133144

134145
exit 0;

0 commit comments

Comments
 (0)