Skip to content

Instantly share code, notes, and snippets.

@vitvad
vitvad / gist:e84b2929fef38927a4bb
Created October 7, 2014 11:16
generate random color pair for paceholde.it
function getPair(num) {
var randColor = function(){
var rnd = Math.random();
var color = Math.floor(rnd * 16777215).toString(16);
var oposite = Math.floor(16777215 - rnd * 16777215).toString(16);
while (oposite.length < 6) {
oposite = '0' + oposite;
}
return color +'/'+ oposite;
}