“JavaScript Cómo establecer los colores RGB al azar” Código de respuesta

JavaScript de color rgba aleatorio excepto negro

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();
Wandering Wolf

JavaScript Cómo establecer los colores RGB al azar

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;
    }
frf games YouTube

Respuestas similares a “JavaScript Cómo establecer los colores RGB al azar”

Preguntas similares a “JavaScript Cómo establecer los colores RGB al azar”

Más respuestas relacionadas con “JavaScript Cómo establecer los colores RGB al azar” en JavaScript

Explore las respuestas de código populares por idioma

Explorar otros lenguajes de código