@@ -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})