public void undo() {
        if (!undo.empty()) {
            ArrayList<Delta> toUndo = undo.pop();
            for (Delta d : toUndo) {
                d.undo(colorArr);
            }
            redo.push(toUndo);
        }
    }