feat: Move and add functions

- Add global function randomFloatFrom()
- Move getRandomColor() to app
This commit is contained in:
sthag 2026-02-13 17:35:09 +01:00
parent 0dfba8e6ee
commit f83b5aa258
3 changed files with 23 additions and 12 deletions

View file

@ -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;
}