Answers for "random rgba color javascript except black"

0

random rgba color javascript except black

function random_bg_color() {
    var x = Math.floor(Math.random() * 256);
    var y = 100+ Math.floor(Math.random() * 256);
    var z = 50+ Math.floor(Math.random() * 256);
    var bgColor = "rgb(" + x + "," + y + "," + z + ")";
 	console.log(bgColor);
  
    document.body.style.background = bgColor;
    }

random_bg_color();
Posted by: Guest on June-15-2020

Code answers related to "Javascript"

Browse Popular Code Answers by Language