Branch Coverage

/root/.cpan/build/Imager-1.018-0/blib/lib/Imager/Color.pm
Criterion Covered Total %
branch 138 180 76.6


line true false branch
25 1 4 if ($sat <= 0) { }
29 0 4 unless $val >= 0
30 0 4 unless $val <= 1
31 0 4 unless $sat <= 1
32 0 4 if $hue >= 360
33 0 4 if $hue < 0
72 2 0 if (open PAL, "< $filename") { }
75 0 2 unless ($hdr =~ /GIMP Palette/)
84 2 2 if $line =~ /^#/ or $line =~ /^\s*$/
87 2 0 if ($name)
108 2 16 if ($args{'palette'}) { }
8 8 elsif (defined $default_gimp_palette) { }
113 8 0 unless (length $default_gimp_palette and -f $default_gimp_palette)
129 3 45 if $work =~ /\$HOME/ and not defined $ENV{'HOME'}
131 0 45 if (-e $work)
136 8 0 unless ($filename)
145 0 2 if (!$gimp_cache{$filename} || (stat $filename)[9] != $gimp_cache{$filename} and not _load_gimp_palette($filename))
151 0 2 unless ($gimp_cache{$filename}{'colors'}{lc $args{'name'}})
184 0 0 if (open RGB, "< $filename") { }
190 0 0 if $line =~ /^[!#]/ or $line =~ /^\s*$/
193 0 0 if ($name)
213 0 15 if ($args{'palette'}) { }
8 7 elsif (defined $default_x_rgb) { }
217 8 0 unless (length $default_x_rgb)
225 0 42 if (-e $attempt)
230 7 0 unless ($filename)
237 0 0 if (!$x_cache{$filename} || (stat $filename)[9] != $x_cache{$filename}{'mod_time'} and not _load_x_rgb($filename))
245 0 0 unless ($x_cache{$filename}{'colors'}{lc $args{'name'}})
259 7 19 if ($alpha =~ /^(.*)%\z/) { }
279 2 2484 if (@_ == 1 and &Scalar::Util::blessed($_[0]))
280 0 2 if ($_[0]->isa('Imager::Color')) { }
2 0 elsif ($_[0]->isa('Imager::Color::Float')) { }
286 1467 1017 if (@_ == 1)
288 29 1438 if ($_[0] =~ /\A$rgb_key\( *$rgb_rgb *\)\z/) { }
4 1434 elsif ($_[0] =~ /\A$rgb_key\( *$rgb_rgb_pc *\)\z/) { }
22 1412 elsif ($_[0] =~ /\A$rgb_key\( *$rgb_rgb$rgb_alpha_sep$rgb_alpha *\)\z/) { }
4 1408 elsif ($_[0] =~ /\A$rgb_key\( *$rgb_rgb_pc$rgb_alpha_sep$rgb_alpha *\)\z/) { }
302 397 2028 if @_ == 3 and not grep(/[^\d.+eE-]/, @_)
303 594 1434 if @_ == 4 and not grep(/[^\d.+eE-]/, @_)
304 13 1421 if ($_[0] =~ /^\#?([\da-f][\da-f])([\da-f][\da-f])([\da-f][\da-f])([\da-f][\da-f])/i)
308 1235 186 if ($_[0] =~ /^\#?([\da-f][\da-f])([\da-f][\da-f])([\da-f][\da-f])/i)
311 145 41 if ($_[0] =~ /^\#([\da-f])([\da-f])([\da-f])$/i)
315 15 26 if (@_ == 1) { }
323 1 40 if (exists $args{'gray'}) { }
1 39 elsif (exists $args{'grey'}) { }
2 37 elsif (exists $args{'red'} || exists $args{'r'} and exists $args{'green'} || exists $args{'g'} and exists $args{'blue'} || exists $args{'b'}) { }
4 33 elsif (exists $args{'hue'} || exists $args{'h'} and exists $args{'saturation'} || exists $args{'s'} and exists $args{'value'} || exists $args{'v'}) { }
2 31 elsif (exists $args{'web'}) { }
16 15 elsif ($args{'name'}) { }
2 13 elsif ($args{'gimp'}) { }
0 13 elsif ($args{'xname'}) { }
3 10 elsif ($args{'builtin'}) { }
1 9 elsif ($args{'rgb'}) { }
2 7 elsif ($args{'rgba'}) { }
1 6 elsif ($args{'hsv'}) { }
4 2 elsif ($args{'channels'}) { }
2 0 elsif (exists $args{'channel0'} or $args{'c0'}) { }
334 1 1 exists $args{'red'} ? :
1 1 exists $args{'green'} ? :
1 1 exists $args{'blue'} ? :
339 2 2 exists $args{'hue'} ? :
340 2 2 exists $args{'saturation'} ? :
341 2 2 exists $args{'value'} ? :
346 1 1 if ($args{'web'} =~ /^#?([\da-f][\da-f])([\da-f][\da-f])([\da-f][\da-f])$/i) { }
1 0 elsif ($args{'web'} =~ /^#?([\da-f])([\da-f])([\da-f])$/i) { }
354 15 1 unless (@result = _get_gimp_color(%args))
355 15 0 unless (@result = _get_x_color(%args))
357 6 9 unless (@result = "Imager::Color::Table"->get($args{'name'}))
379 2 0 if @result == 4
392 4 4 exists $args{"channel$i"} ? :
400 28 1 if (@result)
401 0 28 if (exists $args{'alpha'} or exists $args{'a'})
402 0 0 exists $args{'alpha'} ? :
415 2479 7 @arg ? :
421 0 0 @arg ? :
428 0 3 unless my $other = $opts{'other'}
433 1 2 $ignore_alpha ? :
435 1 10 unless $left[$ch] == $right[$ch]
454 1 4 if ($green > $max)
458 1 4 if ($blue > $max)
463 1 4 if ($green < $min)
466 0 5 if ($blue < $min)
472 2 3 if ($max == $min) { }
1 2 elsif ($maxc eq 'r') { }
1 1 elsif ($maxc eq 'g') { }
1 0 elsif ($maxc eq 'b') { }
486 1 4 if ($max == 0) { }
507 24 19 if ($alpha == 255) { }
512 13 6 if (POSIX::ceil(POSIX::floor($ac / 10) * 10 * 255 / 100) == $alpha) { }
3 3 elsif (POSIX::ceil(POSIX::floor($ac) * 255 / 100) == $alpha) { }