Skip to content

Instantly share code, notes, and snippets.

@timsgardner
Created September 15, 2015 00:54
Show Gist options
  • Save timsgardner/63dccda166e11e13173f to your computer and use it in GitHub Desktop.
Save timsgardner/63dccda166e11e13173f to your computer and use it in GitHub Desktop.
(defn over-color ^Color [^Color a
^Color b]
(let [^Vector4 a (v4 (.r a) (.g a) (.b a) (.a a))
^Vector4 b (v4 (.r b) (.g b) (.b b) (.a b))
c (Vector4/op_Addition
(Vector4/op_Multiply a (float (.w a)))
(Vector4/op_Multiply
(Vector4/op_Multiply b (float (.w b)))
(- 1 (.w a))))
blend (+ (.w a)
(* (.w b)
(- 1 (.w a))))]
(Color. (.x c) (.y c) (.z c) blend)))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment