- Joined
- Jul 24, 2017
- Messages
- 1
- Reaction score
- 0
var brightness = 1;
var secondsUntilChange = 5;
//edit this ^^
//Don't edit the stuff below
setInterval(function() {
var red = Math.random() * brightness;
var green = Math.random() * brightness;
var blue = Math.random() * brightness;
var divs = document.getElementsByTagName("div");
for(var i = 0; i < divs.length; i++){
if(window.getComputedStyle(divs)["background-color"].startsWith('rgb(')) {
var color = window.getComputedStyle(divs)["background-color"].replace('rgb(', '').replace(')', '').split(',');
if(typeof(divs.attributes["trueColor"]) == 'undefined')
divs.attributes["trueColor"] = color;
else
color = divs.attributes["trueColor"];
divs.style.backgroundColor = "rgb(" + Math.floor(parseInt(color[0]) * red) + ", " + Math.floor(parseInt(color[1]) * green) + ", " + Math.floor(parseInt(color[2]) * blue) + ")";
}
}
}, secondsUntilChange * 1000);
var secondsUntilChange = 5;
//edit this ^^
//Don't edit the stuff below
setInterval(function() {
var red = Math.random() * brightness;
var green = Math.random() * brightness;
var blue = Math.random() * brightness;
var divs = document.getElementsByTagName("div");
for(var i = 0; i < divs.length; i++){
if(window.getComputedStyle(divs)["background-color"].startsWith('rgb(')) {
var color = window.getComputedStyle(divs)["background-color"].replace('rgb(', '').replace(')', '').split(',');
if(typeof(divs.attributes["trueColor"]) == 'undefined')
divs.attributes["trueColor"] = color;
else
color = divs.attributes["trueColor"];
divs.style.backgroundColor = "rgb(" + Math.floor(parseInt(color[0]) * red) + ", " + Math.floor(parseInt(color[1]) * green) + ", " + Math.floor(parseInt(color[2]) * blue) + ")";
}
}
}, secondsUntilChange * 1000);