Here you will find getImageData () .
So your solution will look something like this:
function getColor(canvas, x, y) {
var context = canvas.getContext("2d");
var pixel = context.getImageData(x, y, 1, 1);
var rgb = pixel.data;
return rgb;
}
function canvasMouseMove(e) {
var x = e.layerX, y = e.layerY;
var rgb = getColor(canvas, x, y);
var rgb_string = "rgb(" + rgb[0] + "," + rgb[1] + "," + rgb[2] + ")";
document.body.style.backgroundColor = rgb_string;
}
canvas.onmousemove = canvasMouseMove;
@bebraw, - . jQuery JS .