Create a gist now

Instantly share code, notes, and snippets.

What would you like to do?
50 Shades of Grey with CSS and JavaScript
var colour = '';
for (var i = 250; i > 0; i = i - 5) {
colour = 'background-color: rgb(' + i + ',' + i + ',' + i + ')';
console.log(colour);
document.write('<div style="float: left;margin: 5px; width:90px;height:30px;' + colour+ '"></div>');
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment