how do I return the return value of the onload event function through the getColor function?
console.log(getColor(URL));
function getColor (URL) {
const image = new Image()
image.onload = function(){
return {color: "red"}
}
image.src = URL
}
ask for help, thank you!