Search
 
SCRIPT & CODE EXAMPLE
 

JAVASCRIPT

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();
Comment

PREVIOUS NEXT
Code Example
Javascript :: React Hook "React.useState" is called in function "placeItem" which is neither a React function component or a custom React Hook function react-hooks/rules-of-hooks 
Javascript :: show hide more text jquery 
Javascript :: delete element 
Javascript :: onchange js 
Javascript :: return fetch javascript 
Javascript :: js array set value at index 
Javascript :: for range python javascript 
Javascript :: remove a object name from spread operator 
Javascript :: javascript change paragraph text 
Javascript :: mongoose validate on update 
Javascript :: javascript check if string contains substring 
Javascript :: $post in jquery 
Javascript :: discord js check if person banned 
Javascript :: how to reload window in javascript 
Javascript :: How do I redirect to another webpage 
Javascript :: javascript string methods 
Javascript :: angular cli generate component 
Javascript :: javascript get value 
Javascript :: using .includes for an array of objects js 
Javascript :: mean vs mern stack 
Javascript :: javascript hide and show 
Javascript :: add class javascript 
Javascript :: run jest on single file 
Javascript :: node js get time in timezone 
Javascript :: discord.js send message to a given channel 
Javascript :: rxjs map 
Javascript :: js array two dimensional 
Javascript :: javascript object to query params 
Javascript :: Cannot resolve taglib with uri http://java.sun.com/jsp/jstl/core 
Javascript :: how to print to screen in javascript 
ADD CONTENT
Topic
Content
Source link
Name
9+5 =