const colors = ["#000000", "#2a2a2a", "#555555", "#7f7f7f", "#aaaaaa", "#d4d4d4", "#ffffff"];
bg = loadImage("collage3.png")
cross = loadImage("cross.png")
rosary = loadImage("rosary2.png")
createCanvas(windowWidth, windowHeight);
capture = createCapture(VIDEO);
capture.size(camWidth, camHeight);
for (let i = 0; i <= numeyes; i++) {
xvals.push(random(0, 1000));
yvals.push(random(0, 1000));
function pupil(xposition, yposition) {
let xposition2 = xposition + 40
ellipse(xposition, yposition, 30,20);
ellipse(xposition2, yposition, 30,20);
let y = map(mouseY, 0, height, yposition - 5, yposition + 5, true);
let xLeft = map(mouseX, 0, width, xposition - 10, xposition + 10, true);
let xRight = map(mouseX, 0, width, xposition2 - 10, xposition2 + 10, true);
let centerY = (windowHeight / 2) - 400;
let centerX = (windowWidth / 4) - 170;
for (let y = centerY; y < camHeight + centerY; y += sampleSize) {
for (let x = centerX; x < camWidth + centerX; x += sampleSize) {
const i = ((tempY * camWidth) + tempX) * 4;
const r = capture.pixels[i];
const g = capture.pixels[i + 1];
const b = capture.pixels[i + 2];
let index = floor(((r+g+b) / maxColor) * (colors.length-1));
rect(x, y, sampleSize, sampleSize);
image(cross, 420, windowHeight / 7.75, cross.width / 32, cross.height / 32);
image(rosary, 420, windowHeight / 2.75, rosary.width / 12, rosary.height / 12);
for (let i = 0; i < numeyes; i++) {
pupil(xvals[i], yvals[i]);