Skip to content

Commit

Permalink
get palette hexcode function
Browse files Browse the repository at this point in the history
  • Loading branch information
Sagar-Sharma-7 committed Mar 18, 2023
1 parent 05db8e0 commit 24489cb
Showing 1 changed file with 9 additions and 2 deletions.
11 changes: 9 additions & 2 deletions public/js/main.js
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,13 @@ const colorList = [
let n = circle.length;
let i;
for(i = 0; i < n; i++){
hexcode[i].innerHTML = colorList[i]
circle[i].style.backgroundColor = colorList[i]
hexcode[i].innerHTML = colorList[i];
circle[i].style.backgroundColor = colorList[i];
circle[i].title = i
}

circle.forEach(item => {
item.addEventListener("click", () => {
console.log(colorList[item.title]);
})
});

0 comments on commit 24489cb

Please sign in to comment.