Jimin Huang commited on
Commit
5a9e4d8
·
1 Parent(s): 04f06ea

feature: change color

Browse files
frontend/src/pages/LeaderboardPage/components/Leaderboard/hooks/useDataUtils.js CHANGED
@@ -27,7 +27,8 @@ export const useColorGenerator = (minAverage, maxAverage) => {
27
  const normalizedValue = (value - minAverage) / (maxAverage - minAverage);
28
  const red = Math.round(255 * (1 - normalizedValue) * 1);
29
  const green = Math.round(255 * normalizedValue) * 1;
30
- const color = `rgba(${red}, ${green}, 0, 1)`;
 
31
  colorCache.set(value, color);
32
  return color;
33
  };
 
27
  const normalizedValue = (value - minAverage) / (maxAverage - minAverage);
28
  const red = Math.round(255 * (1 - normalizedValue) * 1);
29
  const green = Math.round(255 * normalizedValue) * 1;
30
+ // const color = `rgba(${red}, ${green}, 0, 1)`;
31
+ const color = `rgba(${red}, 0, ${green}, 1)`;
32
  colorCache.set(value, color);
33
  return color;
34
  };