Parcourir la source

Tweak color gen

Kirk Trombley il y a 4 ans
Parent
commit
2a0fe1a5dc
1 fichiers modifiés avec 1 ajouts et 1 suppressions
  1. 1 1
      client/src/hooks/useMarkersFromGuesses/getColorGenerator.js

+ 1 - 1
client/src/hooks/useMarkersFromGuesses/getColorGenerator.js

@@ -5,9 +5,9 @@ const goldenRatioConj = 0.618033988749895;
 const getColorGenerator = () => {
   let h = 0;
   const nextColor = () => {
+    const h6 = h * 6;
     h += goldenRatioConj;
     h %= 1;
-    const h6 = h * 6;
     const hIndex = Math.floor(h6);
     const f = 0.45 * (h6 - hIndex);
     const q = 0.9 - f;