Branch Coverage

/usr/local/lib/perl5/site_perl/5.42.0/x86_64-linux/Colouring/In/XS/include/colouring.h
Criterion Covered Total %
branch 52 122 42.6


line true false branch
54 158 99 return a < b ? a : b;
58 172 85 return a > b ? a : b;
83 360 180 while (*hex) {
85 360 0 if (byte >= '0' && byte <= '9') byte = byte - '0';
240 120 if (byte >= '0' && byte <= '9') byte = byte - '0';
86 120 0 else if (byte >= 'a' && byte <= 'f') byte = byte - 'a' + 10;
120 0 else if (byte >= 'a' && byte <= 'f') byte = byte - 'a' + 10;
87 0 0 else if (byte >= 'A' && byte <= 'F') byte = byte - 'A' + 10;
0 0 else if (byte >= 'A' && byte <= 'F') byte = byte - 'A' + 10;
100 60 0 if (hex[0] == '#') hex++;
103 24 36 if (l == 3) {
109 36 0 } else if (l == 6) {
133 0 0 for (i = 0; i < len; i++) {
134 0 0 if ((str[i] >= '0' && str[i] <= '9') || str[i] == '.') {
0 0 if ((str[i] >= '0' && str[i] <= '9') || str[i] == '.') {
0 0 if ((str[i] >= '0' && str[i] <= '9') || str[i] == '.') {
135 0 0 if (ti < 31) temp[ti++] = str[i];
136 0 0 } else if (ti > 0) {
138 0 0 if (count < max_out) {
145 0 0 if (ti > 0 && count < max_out) {
0 0 if (ti > 0 && count < max_out) {
155 40 92 h = h < 0 ? h + 1 : h > 1 ? h - 1 : h;
0 92 h = h < 0 ? h + 1 : h > 1 ? h - 1 : h;
156 40 92 if (h * 6.0 < 1.0) return m1 + (m2 - m1) * h * 6.0;
157 44 48 if (h * 2.0 < 1.0) return m2;
158 4 44 if (h * 3.0 < 2.0) return m1 + (m2 - m1) * ((2.0 / 3.0) - h) * 6.0;
170 44 0 if (s > 1 || l > 1) {
0 44 if (s > 1 || l > 1) {
174 30 14 m2 = l <= 0.5 ? l * (s + 1) : l + s - l * s;
196 15 29 if (mx != mn) {
197 3 12 s = l > 0.5 ? (d / (2.0 - mx - mn)) : (d / (mx + mn));
198 11 4 if (mx == rn)
199 0 11 h = (gn - bn) / d + (gn < bn ? 6 : 0);
200 0 4 else if (mx == gn)
224 0 0 hsv.s = (mx == 0) ? 0 : d / mx;
227 0 0 if (mx != mn) {
228 0 0 if (mx == rn)
229 0 0 h = (gn - bn) / d + (gn < bn ? 6 : 0);
230 0 0 else if (mx == gn)
246 0 21 if (relative) {
260 0 12 if (relative) {
278 0 0 hsl.a -= colouring_clamp(relative ? hsl.a * amount : amount, 1);
285 0 0 hsl.a += colouring_clamp(relative ? hsl.a * amount : amount, 1);
293 0 2 hsl.s += colouring_clamp(relative ? hsl.s * amount : amount, 1);
300 0 2 hsl.s -= colouring_clamp(relative ? hsl.s * amount : amount, 1);
318 11 0 w1 = (((w * a == -1) ? w : (w + a) / (1 + w * a)) + 1) / 2.0;
346 53 0 if (!force_long) {
348 20 33 if (buf[1] == buf[2] && buf[3] == buf[4] && buf[5] == buf[6]) {
17 3 if (buf[1] == buf[2] && buf[3] == buf[4] && buf[5] == buf[6]) {
17 0 if (buf[1] == buf[2] && buf[3] == buf[4] && buf[5] == buf[6]) {
391 60 1 if (str[0] == '#') {
394 1 0 } else if (str[0] == 'r' && str[1] == 'g' && str[2] == 'b') {
0 1 } else if (str[0] == 'r' && str[1] == 'g' && str[2] == 'b') {
0 0 } else if (str[0] == 'r' && str[1] == 'g' && str[2] == 'b') {
397 0 0 if (n < 3) return 0;
401 0 0 out->a = n >= 4 ? nums[3] : 1.0;
403 0 1 } else if (str[0] == 'h' && str[1] == 's' && str[2] == 'l') {
0 0 } else if (str[0] == 'h' && str[1] == 's' && str[2] == 'l') {
0 0 } else if (str[0] == 'h' && str[1] == 's' && str[2] == 'l') {
406 0 0 if (n < 3) return 0;
407 0 0 *out = colouring_hsl2rgb(nums[0], nums[1], nums[2],