Branch Coverage

blib/lib/Color/RGB/Util.pm
Criterion Covered Total %
branch 115 172 66.8


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 104 unless my($r1, $g1, $b1) = $rgb1 =~ /$re_rgb/
141 0 104 unless my($r2, $g2, $b2) = $rgb2 =~ /$re_rgb/
153 0 31 ref $_[0] eq 'HASH' ? :
155 0 31 exists $opts->{'light_color'} ? :
171 74 0 if ($light_color) { }
0 0 elsif (defined $light_color) { }
172 39 35 if (rgb_is_dark($rgb))
174 0 0 if (rgb_is_light($rgb))
176 0 35 if ($avoid_colors and ref $avoid_colors eq 'ARRAY')
177 0 0 if (grep {$rgb eq $_;} @$avoid_colors)
179 0 35 if ($avoid_colors and ref $avoid_colors eq 'HASH')
180 0 0 if ($avoid_colors->{$rgb})
184 35 10 if @res - $_ < 0
186 0 10 if (rgb_diff($rgb, $prev_rgb, 'approx2') < $min_distance)
190 35 39 unless $reject
191 0 39 if ++$num_attempts >= $max_attempts
193 0 35 $hash_prefix ? :
201 0 1 unless my($r, $g, $b) = $rgb =~ /$re_rgb/
211 0 3 unless my($r, $g, $b) = $rgb =~ /$re_rgb/
216 1 2 if ($algo eq 'weighted_average') { }
1 1 elsif ($algo eq 'average') { }
231 0 65 unless $rgb =~ /$re_rgb/
239 0 1 unless my($r, $g, $b) = $rgb =~ /$re_rgb/
247 0 3 if $_ > 255
256 0 45 unless my($r1, $g1, $b1) = $rgb1 =~ /$re_rgb/
258 0 45 unless my($r2, $g2, $b2) = $rgb2 =~ /$re_rgb/
266 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') { }
268 3 41 if ($algo eq 'approx1') { }
271 33 8 if ($rm < 128) { }
287 0 0 if ($algo eq 'hsv_hue1') { }
302 0 179 unless my($r1, $g1, $b1) = $rgb1 =~ /$re_rgb/
304 0 179 unless my($r2, $g2, $b2) = $rgb2 =~ /$re_rgb/
313 43 38 rgb_distance($rgb, '000000') < rgb_distance($rgb, 'ffffff') ? :
318 3 4 rgb_distance($rgb, '000000') > rgb_distance($rgb, 'ffffff') ? :
329 0 3 unless my($r, $g, $b) = $rgb =~ /$re_rgb/
341 0 5 unless my($r1, $g1, $b1) = $rgb1 =~ /$re_rgb/
343 0 5 unless my($r2, $g2, $b2) = $rgb2 =~ /$re_rgb/
359 0 3 unless my($r, $g, $b) = $rgb =~ /$re_rgb/
367 1 2 if ($g > $max)
371 1 2 if ($b > $max)
376 1 2 if ($g < $min)
379 0 3 if ($b < $min)
384 0 3 if ($max == $min) { }
1 2 elsif ($maxc eq 'r') { }
1 1 elsif ($maxc eq 'g') { }
1 0 elsif ($maxc eq 'b') { }
396 0 3 if ($max == $min) { }
2 1 elsif ($l <= 0.5) { }
410 0 3 unless my($r, $g, $b) = $rgb =~ /$re_rgb/
418 1 2 if ($g > $max)
422 1 2 if ($b > $max)
427 1 2 if ($g < $min)
430 0 3 if ($b < $min)
436 0 3 if ($max == $min) { }
1 2 elsif ($maxc eq 'r') { }
1 1 elsif ($maxc eq 'g') { }
1 0 elsif ($maxc eq 'b') { }
447 0 3 if ($max == 0) { }
460 2 7 unless $h >= 0 and $h <= 360
0 9 unless $s >= 0 and $s <= 1
0 9 unless $l >= 0 and $l <= 1
466 7 2 $l <= 1 ? :
477 1 4 unless $h >= 0 and $h <= 360
0 5 unless $s >= 0 and $s <= 1
0 5 unless $v >= 0 and $v <= 1
482 0 4 $_l == 0 ? :
4 1 $_l <= 1 ? :
496 1 7 unless $h >= 0 and $h <= 360
0 8 unless $s >= 0 and $s <= 1
0 8 unless $v >= 0 and $v <= 1
505 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) { }