Created
April 23, 2015 00:08
-
-
Save oscarmorrison/084411e505dc36f0ba52 to your computer and use it in GitHub Desktop.
Creates a shade of blue over supplied range
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 numbers = [] //Array of numbers | |
var range = 100 // Maximum number | |
for (var i = 0; i < range; i++) { | |
numbers.push(Math.round(Math.random()*range)); | |
} | |
blue_color_shade = function (range,number) { | |
var ratio = 255/range; | |
var shade = Math.round(number*ratio).toString(16) | |
if (shade.length==1){shade = "0"+shade}; | |
return "#0000"+shade; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment