Skip to content

Instantly share code, notes, and snippets.

@jefBinomed
Created June 17, 2015 14:53
Show Gist options
  • Save jefBinomed/2a401edfc41f48252f51 to your computer and use it in GitHub Desktop.
Save jefBinomed/2a401edfc41f48252f51 to your computer and use it in GitHub Desktop.
Programmez-07/08_2015-PortalWebrtc-09
// setpixels in imageData
vardrawPixel = function(x,y, color)
{
varoffset = (x + y*imageData.width)*4;
imageData.data[offset] = color[0];
imageData.data[offset + 1] = color[1];
imageData.data[offset + 2] = color[2];
if (color[0] <= 100 && color[1] === 0 && color[2] <= 100){
imageData.data[offset + 3] = 0;
}else{
imageData.data[offset + 3] = 255;
}
};
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment