JavaScript - - By Sam Deering

Generating Random Color Values using JavaScript

JavaScript Code snippet to generate a random RGB color. Could be useful for supplying color values to transitions to/from with a single line of code.


See Demo

var hue = 'rgb(' + (Math.floor(Math.random() * 256)) + ',' + (Math.floor(Math.random() * 256)) + ',' + (Math.floor(Math.random() * 256)) + ')';
Sponsors