Branch Coverage

blib/lib/Color/RGB/Util.pm
Criterion Covered Total %
branch 107 164 65.2


line true false branch
46 0 0 $_[0] < $_[1] ? :
51 7 5 if abs $h > 360
52 10 2 $h >= 0 ? :
70 2 1 rgb_is_dark($rgb) ? :
77 1 2 rgb_is_light($rgb) ? :
95 1 8 unless my($r1, $g1, $b1) = $rgb1 =~ /$re_rgb/
97 0 8 unless my($r2, $g2, $b2) = $rgb2 =~ /$re_rgb/
114 1 9 unless my($r, $g, $b) = $rgb =~ /$re_rgb/
125 2 3 unless $tot_weight > 0
138 0 86 unless my($r1, $g1, $b1) = $rgb1 =~ /$re_rgb/
141 0 86 unless my($r2, $g2, $b2) = $rgb2 =~ /$re_rgb/
153 0 31 ref $_[0] eq 'HASH' ? :
155 0 31 exists $opts->{'light_color'} ? :
170 56 0 if ($light_color) { }
0 0 elsif (defined $light_color) { }
171 21 35 if (rgb_is_dark($rgb))
173 0 0 if (rgb_is_light($rgb))
175 0 35 if ($avoid_colors and ref $avoid_colors eq 'ARRAY')
176 0 0 if (grep {$rgb eq $_;} @$avoid_colors)
178 0 35 if ($avoid_colors and ref $avoid_colors eq 'HASH')
179 0 0 if ($avoid_colors->{$rgb})
183 35 10 if @res - $_ < 0
185 0 10 if (rgb_diff($rgb, $prev_rgb, 'approx2') < $min_distance)
189 35 21 unless $reject
190 0 21 if ++$num_attempts >= $max_attempts
200 0 1 unless my($r, $g, $b) = $rgb =~ /$re_rgb/
210 0 1 unless my($r, $g, $b) = $rgb =~ /$re_rgb/
223 0 65 unless $rgb =~ /$re_rgb/
231 0 1 unless my($r, $g, $b) = $rgb =~ /$re_rgb/
239 0 3 if $_ > 255
248 0 44 unless my($r1, $g1, $b1) = $rgb1 =~ /$re_rgb/
250 0 44 unless my($r2, $g2, $b2) = $rgb2 =~ /$re_rgb/
258 44 0 if ($algo eq 'approx1' or $algo eq 'approx2') { }
0 0 elsif ($algo eq 'hsv_euclidean' or $algo eq 'hsv_hue1') { }
260 3 41 if ($algo eq 'approx1') { }
263 35 6 if ($rm < 128) { }
279 0 0 if ($algo eq 'hsv_hue1') { }
292 0 143 unless my($r1, $g1, $b1) = $rgb1 =~ /$re_rgb/
294 0 143 unless my($r2, $g2, $b2) = $rgb2 =~ /$re_rgb/
303 25 38 rgb_distance($rgb, '000000') < rgb_distance($rgb, 'ffffff') ? :
308 3 4 rgb_distance($rgb, '000000') > rgb_distance($rgb, 'ffffff') ? :
319 0 3 unless my($r, $g, $b) = $rgb =~ /$re_rgb/
331 0 5 unless my($r1, $g1, $b1) = $rgb1 =~ /$re_rgb/
333 0 5 unless my($r2, $g2, $b2) = $rgb2 =~ /$re_rgb/
349 0 3 unless my($r, $g, $b) = $rgb =~ /$re_rgb/
357 1 2 if ($g > $max)
361 1 2 if ($b > $max)
366 1 2 if ($g < $min)
369 0 3 if ($b < $min)
374 0 3 if ($max == $min) { }
1 2 elsif ($maxc eq 'r') { }
1 1 elsif ($maxc eq 'g') { }
1 0 elsif ($maxc eq 'b') { }
386 0 3 if ($max == $min) { }
2 1 elsif ($l <= 0.5) { }
400 0 3 unless my($r, $g, $b) = $rgb =~ /$re_rgb/
408 1 2 if ($g > $max)
412 1 2 if ($b > $max)
417 1 2 if ($g < $min)
420 0 3 if ($b < $min)
426 0 3 if ($max == $min) { }
1 2 elsif ($maxc eq 'r') { }
1 1 elsif ($maxc eq 'g') { }
1 0 elsif ($maxc eq 'b') { }
437 0 3 if ($max == 0) { }
450 2 7 unless $h >= 0 and $h <= 360
0 9 unless $s >= 0 and $s <= 1
0 9 unless $l >= 0 and $l <= 1
456 7 2 $l <= 1 ? :
467 1 4 unless $h >= 0 and $h <= 360
0 5 unless $s >= 0 and $s <= 1
0 5 unless $v >= 0 and $v <= 1
472 0 4 $_l == 0 ? :
4 1 $_l <= 1 ? :
486 1 7 unless $h >= 0 and $h <= 360
0 8 unless $s >= 0 and $s <= 1
0 8 unless $v >= 0 and $v <= 1
495 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) { }