MCPcopy Create free account
hub / github.com/CodeWithHarry/Sigma-Web-Dev-Course / getRandomColor

Function getRandomColor

Video 72/script.js:6–11  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

4
5
6function getRandomColor(){
7 let val1 = Math.ceil(0 + Math.random()* 255);
8 let val2 = Math.ceil(0 + Math.random()* 255);
9 let val3 = Math.ceil(0 + Math.random()* 255);
10 return `rgb(${val1}, ${val2}, ${val3})`
11}
12Array.from(boxes).forEach(e=>{
13 e.style.backgroundColor = getRandomColor()
14 e.style.color = getRandomColor()

Callers 1

script.jsFile · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected