Created
February 26, 2016 15:39
-
-
Save ateliercw/bec18887475537963cbb 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
func differenceFrom(otherRGBA: UIImage.RGBA) -> Int { | |
return Int(max(alpha, otherRGBA.alpha) - min(alpha, otherRGBA.alpha)) + | |
Int(max(red, otherRGBA.red) - min(red, otherRGBA.red)) + | |
Int(max(green, otherRGBA.green) - min(green, otherRGBA.green)) + | |
Int(max(blue, otherRGBA.green) - min(blue, otherRGBA.blue)) | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment