Created
August 2, 2012 14:05
-
-
Save adjohu/3237325 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var highest = 16777215; | |
var steps = 1000; | |
var step = highest / steps; | |
var emptyColor = "000000"; | |
for (var i=0; i < steps; i++) { | |
var color = parseInt(step * i, 10).toString(16); | |
color = emptyColor.slice(0, -color.length) + color; | |
var span = document.createElement("span"); | |
span.innerHTML = "a" | |
span.style.color = "#" + color; | |
document.body.appendChild(span); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment