Branch Coverage

blib/lib/Color/RGB/Util.pm
Criterion Covered Total %
branch 115 176 65.3


line true false branch
49 0 0 if ($_[0] < $_[1]) { }
54 7 5 if abs $h > 360
55 10 2 $h >= 0 ? :
73 2 1 rgb_is_dark($rgb) ? :
80 1 2 rgb_is_light($rgb) ? :
98 1 8 unless my($r1, $g1, $b1) = $rgb1 =~ /$re_rgb/
100 0 8 unless my($r2, $g2, $b2) = $rgb2 =~ /$re_rgb/
117 1 9 unless my($r, $g, $b) = $rgb =~ /$re_rgb/
128 2 3 unless $tot_weight > 0
162 0 101 unless my($r1, $g1, $b1) = $rgb1 =~ /$re_rgb/
165 0 101 unless my($r2, $g2, $b2) = $rgb2 =~ /$re_rgb/
177 0 31 ref $_[0] eq 'HASH' ? :
179 0 31 exists $opts->{'light_color'} ? :
197 71 0 if ($light_color) { }
0 0 elsif (defined $light_color) { }
198 36 35 if (rgb_is_dark($rgb))
200 0 0 if (rgb_is_light($rgb))
202 0 35 if ($avoid_colors and ref $avoid_colors eq "ARRAY")
203 0 0 if (grep {$rgb eq $_;} @$avoid_colors)
205 0 35 if ($avoid_colors and ref $avoid_colors eq "HASH")
206 0 0 if ($avoid_colors->{$rgb})
210 35 10 if @res - $_ < 0
212 0 10 if (rgb_diff($rgb, $prev_rgb, "approx2") < $min_distance)
216 35 36 unless $reject
217 0 36 if ++$num_attempts >= $max_attempts
219 0 35 $hash_prefix ? :
227 0 1 unless my($r, $g, $b) = $rgb =~ /$re_rgb/
237 0 3 unless my($r, $g, $b) = $rgb =~ /$re_rgb/
242 1 2 if ($algo eq 'weighted_average') { }
1 1 elsif ($algo eq 'average') { }
257 0 65 unless $rgb =~ /$re_rgb/
265 0 1 unless my($r, $g, $b) = $rgb =~ /$re_rgb/
273 0 3 if $_ > 255
282 0 45 unless my($r1, $g1, $b1) = $rgb1 =~ /$re_rgb/
284 0 45 unless my($r2, $g2, $b2) = $rgb2 =~ /$re_rgb/
292 44 1 if ($algo eq 'approx1' or $algo eq 'approx2') { }
0 1 elsif ($algo eq 'hsv_euclidean' or $algo eq 'hsv_hue1') { }
0 1 elsif ($algo eq 'euclidean') { }
294 3 41 if ($algo eq 'approx1') { }
297 34 7 if ($rm < 128) { }
313 0 0 if ($algo eq 'hsv_hue1') { }
328 0 173 unless my($r1, $g1, $b1) = $rgb1 =~ /$re_rgb/
330 0 173 unless my($r2, $g2, $b2) = $rgb2 =~ /$re_rgb/
339 40 38 rgb_distance($rgb, '000000') < rgb_distance($rgb, 'ffffff') ? :
344 3 4 rgb_distance($rgb, '000000') > rgb_distance($rgb, 'ffffff') ? :
355 0 3 unless my($r, $g, $b) = $rgb =~ /$re_rgb/
367 0 5 unless my($r1, $g1, $b1) = $rgb1 =~ /$re_rgb/
369 0 5 unless my($r2, $g2, $b2) = $rgb2 =~ /$re_rgb/
385 0 3 unless my($r, $g, $b) = $rgb =~ /$re_rgb/
393 1 2 if ($g > $max)
397 1 2 if ($b > $max)
402 1 2 if ($g < $min)
405 0 3 if ($b < $min)
410 0 3 if ($max == $min) { }
1 2 elsif ($maxc eq 'r') { }
1 1 elsif ($maxc eq 'g') { }
1 0 elsif ($maxc eq 'b') { }
422 0 3 if ($max == $min) { }
2 1 elsif ($l <= 0.5) { }
436 0 3 unless my($r, $g, $b) = $rgb =~ /$re_rgb/
444 1 2 if ($g > $max)
448 1 2 if ($b > $max)
453 1 2 if ($g < $min)
456 0 3 if ($b < $min)
462 0 3 if ($max == $min) { }
1 2 elsif ($maxc eq 'r') { }
1 1 elsif ($maxc eq 'g') { }
1 0 elsif ($maxc eq 'b') { }
473 0 3 if ($max == 0) { }
486 2 7 unless $h >= 0 and $h <= 360
0 9 unless $s >= 0 and $s <= 1
0 9 unless $l >= 0 and $l <= 1
492 7 2 $l <= 1 ? :
503 1 4 unless $h >= 0 and $h <= 360
0 5 unless $s >= 0 and $s <= 1
0 5 unless $v >= 0 and $v <= 1
508 0 4 $_l == 0 ? :
4 1 $_l <= 1 ? :
522 1 7 unless $h >= 0 and $h <= 360
0 8 unless $s >= 0 and $s <= 1
0 8 unless $v >= 0 and $v <= 1
531 4 4 if ($i == 0) { }
0 4 elsif ($i == 1) { }
2 2 elsif ($i == 2) { }
0 2 elsif ($i == 3) { }
2 0 elsif ($i == 4) { }
564 0 0 ref $_[0] eq 'HASH' ? :
571 0 0 if (not defined $min_diff or $min_diff > $diff)