Skip to content

Commit 8730e94

Browse files
committed
Typecast from int to double.
1 parent fbd3be0 commit 8730e94

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

src/rgb.h

+4-4
Original file line numberDiff line numberDiff line change
@@ -78,9 +78,9 @@ H_INLINE int MMRGBColorSimilarToColor(MMRGBColor c1, MMRGBColor c2,
7878
uint8_t d1 = c1.red - c2.red;
7979
uint8_t d2 = c1.green - c2.green;
8080
uint8_t d3 = c1.blue - c2.blue;
81-
/*return sqrt((d1 * d1) +
81+
return sqrt((double)(d1 * d1) +
8282
(d2 * d2) +
83-
(d3 * d3)) <= (tolerance * 442.0f);*/
83+
(d3 * d3)) <= (tolerance * 442.0f);
8484
}
8585

8686
}
@@ -94,9 +94,9 @@ H_INLINE int MMRGBHexSimilarToColor(MMRGBHex h1, MMRGBHex h2, float tolerance)
9494
uint8_t d1 = RED_FROM_HEX(h1) - RED_FROM_HEX(h2);
9595
uint8_t d2 = GREEN_FROM_HEX(h1) - GREEN_FROM_HEX(h2);
9696
uint8_t d3 = BLUE_FROM_HEX(h1) - BLUE_FROM_HEX(h2);
97-
/*return sqrt((d1 * d1) +
97+
return sqrt((double)(d1 * d1) +
9898
(d2 * d2) +
99-
(d3 * d3)) <= (tolerance * 442.0f);*/
99+
(d3 * d3)) <= (tolerance * 442.0f);
100100
}
101101
}
102102

0 commit comments

Comments
 (0)