Created
October 18, 2010 19:21
-
-
Save Serabe/632852 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
(defmacro porter-duff-rule | |
"Defines a composite. A composite accepts an optional parameter. If given, it is the factor to multiply the alpha of the source." | |
[name] | |
(let [field-name (.. (str name) toUpperCase (replace \- \_)) | |
alpha (symbol (str "AlphaComposite/" field-name))] | |
`(defn ~name | |
([] (AlphaComposite/getInstance ~alpha)) | |
([factor#] (AlphaComposite/getInstance ~alpha factor#))))) | |
(porter-duff-rule src-out) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment