Преглед изворни кода

Generate random colors in HSL for better visual diff

Kirk Trombley пре 3 година
родитељ
комит
ef210e7f4c
1 измењених фајлова са 1 додато и 1 уклоњено
  1. 1 1
      web/listeners.js

+ 1 - 1
web/listeners.js

@@ -137,7 +137,7 @@ const onColorChanged = (state, newValue) => {
 };
 
 const onRandomColor = state => {
-  const color = rgb2hex([Math.random(), Math.random(), Math.random()].map(c => c * 255));
+  const color = d3.hsl(Math.random() * 360, Math.random(), Math.random()).formatHex();
   document.getElementById("color-input").value = color;
   onColorChanged(state, color); // triggers rescore
 };