Skip to content

Instantly share code, notes, and snippets.

@jshawl
Created July 14, 2015 21:25
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save jshawl/bb813b0631b50fe8ba92 to your computer and use it in GitHub Desktop.
Save jshawl/bb813b0631b50fe8ba92 to your computer and use it in GitHub Desktop.
<!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