Created
October 28, 2011 14:52
-
-
Save hughfdjackson/1322462 to your computer and use it in GitHub Desktop.
Monad?
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
function colorScheme(r, g, b){ | |
return function(callback){ | |
return callback(r, g, b) | |
} | |
} | |
function darken(darken_by){ | |
return function(r, g, b){ | |
return colorScheme(r - darken_by, g - darken_by, b - darken_by) | |
} | |
} | |
var MyColor = colorScheme(50, 50, 100) | |
var Darker = MyColor(darken(10)) | |
Darker(function(r, g, b){ console.log(r, g, b) }) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment