script.js
//references to inputs and color box.
references to inputs and color box.
references to inputs and color box .
function initColorPicker() {
	let colorBox = document.getElementById("color-box");
	let colors = {
		red: document.getElementById("red"),
		green: document.getElementById("green"),
		blue: document.getElementById("blue")
	};
	let colorPickers= document.getElementsByClassName("picker");
	setColorPickerEventListeners(colorBox, colors, colorPickers);
}
function initColorPicker ( ) { let colorBox = document . getElementById ( "color-box" ) ; let colors = { red : document . getElementById ( "red" ) , green : document . getElementById ( "green" ) , blue : document . getElementById ( "blue" ) } ; let colorPickers = document . getElementsByClassName ( "picker" ) ; setColorPickerEventListeners ( colorBox , colors , colorPickers ) ; }
references to inputs and color box.
references to inputs and color box .
//solution 1: since prob 1 would require we change that line of code for each colors even listener if there was a change in the function setBoxBGColor we create the below array followed by a for loop at the begining of the function setColorPickerEventListeners to loop through this array.