how to get color of pixel html canvas code example Example: getImageData() ctx.getImageData(sx, sy, sw, sh);