Advanced Photo Editor

Basic Features

Step 14: Show the pixel's color when the canvas is clicked.
Hint: Use the mouse coordinates to get the correct pixel:
yourCanvasVariable.addEventListener(`click`, showColor)

function showColor(event) {
  // get the mouse coordinates relative to the canvas
  let x = event.offsetX
  let y = event.offsetY

  // write code here to show the pixel's color
}
Last step Next step