    }

        // let canvasElem = document.querySelector("canvas");

        theCanvas.addEventListener("mousedown", function (e) {
            changePixelColor(theCanvas, e);
            draw();
        });

        theCanvas.addEventListener("mousemove", function (e) {
            getMousePosition(theCanvas, e);
            draw();
        });

        theCanvas.addEventListener("keydown", function (e) {
            switch (e.code) {
            case "Digit1": favColor = 1; break;
            case "Digit