소스 검색

Tweak color gen

Kirk Trombley 4 년 전
부모
커밋
2a0fe1a5dc
1개의 변경된 파일1개의 추가작업 그리고 1개의 파일을 삭제
  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;