Example 1: get() Sampler
Code
let img;
function preload() {
img = loadImage('../assets/images/map.jpg');
}
function setup() {
createCanvas(400, 400);
pixelDensity(1);
}
function draw() {
image(img, 0, 0, width, height);
const c = get(mouseX, mouseY);
fill(c);
noStroke();
rect(12, 12, 80, 80, 8);
stroke(255, 45, 140);
noFill();
circle(mouseX, mouseY, 18);
}Try this: Sample a 10x10 area and average color values.