Skip to content

Instantly share code, notes, and snippets.

@jmahony
Created November 30, 2015 17:03
Show Gist options
  • Save jmahony/072e63f85385e2bb53a9 to your computer and use it in GitHub Desktop.
Save jmahony/072e63f85385e2bb53a9 to your computer and use it in GitHub Desktop.
Simple script to make things easier to line up
function coloursize() {
$('.colourise').each(function() {
var $el = $(this);
setBackgroundColour($el);
$el.find('*').each(function() {
setBackgroundColour($(this));
});
});
function getRandomColour() {
return '#'+Math.floor(Math.random()*16777215).toString(16);
}
function setBackgroundColour($el) {
$el.css('background', getRandomColour());
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment