fix(Fortune Wheel): some string hashcode

Fix #597
This commit is contained in:
ShareVB committed 2026-11-29 21:35:50 +01:00
1 parent 2b77e593cd
commit 4da56575c2
1 file changed
+2 -2
+2 -2
View File
@@ -60,7 +60,7 @@ function getContrastColor(hue: number, saturation: number, lightness: number): s
const m = l - c / 2;
// Compact RGB calculation using array indexing
const hueSegment = Math.floor(h * 6);
const hueSegment = Math.floor(Math.abs(h) * 6);
const rgbValues = [
[c, x, 0], // 0-60°
[x, c, 0], // 60-120°
@@ -70,7 +70,7 @@ function getContrastColor(hue: number, saturation: number, lightness: number): s
[c, 0, x], // 300-360°
];
const [r, g, b] = rgbValues[hueSegment].map((val) => (val + m) * 255);
const [r, g, b] = rgbValues[hueSegment % 6].map((val) => (val + m) * 255);
// Calculate relative luminance and return appropriate contrast color
const luminance = (0.299 * r + 0.587 * g + 0.114 * b) / 255;