Instantly share code, notes, and snippets.

Embed
What would you like to do?
<!DOCTYPE html>
<div id="wrapper"></div>
<script>
var limit = 100;
var step = 256 / limit;
var wrapper = document.getElementById('wrapper');
for (var color = 0; color < 256; color += step) {
color = Math.round(color);
console.log(color);
var span = document.createElement('span');
span.innerHTML = '&nbsp;';
span.style.background = 'rgb(0, 0, ' + color + ')';
wrapper.appendChild(span);
}
</script>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment