Created
July 14, 2015 21:25
-
-
Save jshawl/bb813b0631b50fe8ba92 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
<!doctype html> | |
<html> | |
<head></head> | |
<body> | |
<script> | |
var color = colorize(3,2,1) | |
function colorize(red, yellow, green){ | |
yells = yellow / 2 | |
red += yells | |
green += yells | |
var total = red + green | |
var redHex = 256 * (red / total) | |
var greenHex = 256 * (green / total) | |
document.body.style.background = "rgb("+redHex+","+greenHex+",0)" | |
//alert(red + " " + green) | |
} | |
</script> | |
</body> | |
</html> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment