Skip to content

Commit

Permalink
Allow for a single replacement hue for chromaKey
Browse files Browse the repository at this point in the history
  • Loading branch information
brycebaril committed Sep 30, 2014
1 parent 824efe6 commit 93213f6
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion glitcher.js
Original file line number Diff line number Diff line change
Expand Up @@ -563,7 +563,8 @@ function getAlpha(rgba) {
function _chromaKey(rgba, maskHue, background, alpha, isInside) {
for (var i = 0; i < rgba.length; i += 4) {
if (inSphere(maskHue, alpha, rgba.slice(i, i + 4)) == isInside) {
background.copy(rgba, i, i, i + 4)
var start = (i > background.length) ? 0 : i
background.copy(rgba, i, start, start + 4)
}
}
}
Expand Down

0 comments on commit 93213f6

Please sign in to comment.