This is more of a logic question. I can't figure out what is wrong with my function
// This function is meant to check if 3 pixels
// are colored and therefore if the canvas is full
function checkIfFull() {
let emptyPixel = [0, 0, 0, 0];
let pixel1 = get(1, 1);
//let pixel2 = get(599,599);
//let pixel3 = get(400, 50);
console.log(pixel1);
if (pixel1 === emptyPixel) {
console.log(true);
} else {
console.log(false);
}
}
I am running the P5.js library. The get() is giving me an Array [a, b, c, d] and I am trying to test for equality or differences between those two (emptyPixel / pixel1)
These are the things I have tried: Testing every position within the arrays.
Thanks!