diff --git a/js/script.js b/js/script.js index 1e75475..6580a19 100644 --- a/js/script.js +++ b/js/script.js @@ -796,6 +796,9 @@ function Add_EventHandlers_To_Document() { Delete_Selected(); } + if(e.code === "KeyK"){ + Clear_Paint_From_Canvas() + } if(e.code === "Escape") { Remove_Selection(); diff --git a/js/utils.js b/js/utils.js index 229edc6..c4d272d 100644 --- a/js/utils.js +++ b/js/utils.js @@ -163,3 +163,11 @@ function Get_Canvas_Pixels() }) return canvasPixels; } + +function Clear_Paint_From_Canvas() +{ + let canvasCells = document.querySelectorAll(".canvasCell"); + canvasCells.forEach(function(cell){ + cell.style.backgroundColor = CANVAS_INIT_COLOR; + }) +} \ No newline at end of file