Sfoglia il codice sorgente

setRgb - array removed

vladislavaSim 1 anno fa
parent
commit
f59c706389
1 ha cambiato i file con 1 aggiunte e 3 eliminazioni
  1. 1 3
      tuner/index.js

+ 1 - 3
tuner/index.js

@@ -62,9 +62,7 @@ volumeControl.onchange = (value => {
 setTimeout(() => volumeControl.setValue(80), 2000)
 
 function setRGB(value, n){
-    let arr = ['rgb', '(', red.getValue(), ', ', green.getValue(), ', ', blue.getValue(), ')']
-            arr[n + n + 2] = value
-    colorBox.style.backgroundColor = arr.join('')
+    colorBox.style.backgroundColor = `rgb(${red.getValue()}, ${green.getValue()}, ${blue.getValue()})`
 }
 
 const red  = new Control(container2, {min: 0, max: 255})