Skip to content

Instantly share code, notes, and snippets.

@ovcharik
Last active August 29, 2015 14:23
Show Gist options
  • Save ovcharik/2943d36fd967b498aaa5 to your computer and use it in GitHub Desktop.
Save ovcharik/2943d36fd967b498aaa5 to your computer and use it in GitHub Desktop.
createjs.InverseAlphaFilter.coffee
class InverseAlphaFilter extends createjs.Filter
constructor: ->
toString: ->
return "[InverseAlphaFilter]"
clone: ->
new InverseAlphaFilter
_applyFilter: (imageData) ->
data = imageData.data
l = data.length
i = 0
while (i < l)
data[i+3] = 255 - data[i+3]
i += 4
return true
createjs.InverseAlphaFilter = createjs.promote(InverseAlphaFilter, "Filter")
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment