Skip to content

Commit

Permalink
Merge pull request #4 from YT-Toaster/master
Browse files Browse the repository at this point in the history
Updated JS to actually invert properly.
  • Loading branch information
Wolfyxon authored May 20, 2024
2 parents c00238c + aab7e31 commit 233bb56
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions js/test/script.js
Original file line number Diff line number Diff line change
Expand Up @@ -46,8 +46,8 @@ window.addEventListener("load", () => {
for(let x = 0; x < frame.width; x++) {
const c = frame.getColor(x, y);

if(chkInvert.checked) ctx.fillStyle = `rgb(${c.b},${c.g},${c.r})`;
else ctx.fillStyle = `rgb(${c.r},${c.g},${c.b})`;
if(chkInvert.checked) ctx.fillStyle = `rgb(${c.r},${c.g},${c.b})`;
else ctx.fillStyle = `rgb(${c.b},${c.g},${c.r})`;

const w = canvas.width / video.width;
const h = canvas.height / video.height;
Expand Down Expand Up @@ -80,4 +80,4 @@ window.addEventListener("load", () => {

btnPlay.addEventListener("click", play);

});
});

0 comments on commit 233bb56

Please sign in to comment.