Is this code harmless let me know plz and thx

Discussion in 'Introductions' started by knowsnothingaboutcoding, Jul 24, 2017.

  1. knowsnothingaboutcoding

    knowsnothingaboutcoding

    Joined:
    Jul 24, 2017
    Messages:
    1
    Likes Received:
    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);
     
    knowsnothingaboutcoding, Jul 24, 2017
    #1
    1. Advertisements

  2. knowsnothingaboutcoding

    John Joe

    Joined:
    Apr 25, 2017
    Messages:
    114
    Likes Received:
    14
    Location:
    Malaysia
    We have no idea what is the program about. Would you mind to spend some time to describe it ?
     
    John Joe, Jul 24, 2017
    #2
    1. Advertisements

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments (here). After that, you can post your question and our members will help you out.