Skip to content

Instantly share code, notes, and snippets.

@JonathanMH
Last active August 29, 2015 14:15
Show Gist options
  • Save JonathanMH/c1177779b9c3d6442691 to your computer and use it in GitHub Desktop.
Save JonathanMH/c1177779b9c3d6442691 to your computer and use it in GitHub Desktop.
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