Posted By

jatkins on 10/14/14


Tagged

css html colours colour color colors RGB


Versions (?)

Random RGB component value / color


 / Published in: JavaScript
 

Released into the public domain by Josh Atkins, 2014.

  1. function randomRGBComponent() {
  2. return Math.round(Math.random() * 255);
  3. }
  4.  
  5. function randomRGBColor() {
  6. return 'rgb(' + randomRGBComponent() + ', ' + randomRGBComponent() + ', ' + randomRGBComponent() + ')';
  7. }

Report this snippet  

You need to login to post a comment.