feat: Move and add functions
- Add global function randomFloatFrom() - Move getRandomColor() to app
This commit is contained in:
parent
0dfba8e6ee
commit
f83b5aa258
3 changed files with 23 additions and 12 deletions
|
|
@ -113,15 +113,3 @@ class NewDiv {
|
|||
space.appendChild(this.element);
|
||||
}
|
||||
}
|
||||
|
||||
// Function to generate a random color
|
||||
function getRandomColor() {
|
||||
const letters = '0123456789ABCDEF';
|
||||
let color = '#';
|
||||
|
||||
for (let i = 0; i < 6; i++) {
|
||||
color += letters[Math.floor(Math.random() * 16)];
|
||||
}
|
||||
|
||||
return color;
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue