browser-image
    Preparing search index...
    • The average color around pixel (x, y), as sRGB-encoded [R, G, B] in 0-1, averaged in linear light and skipping transparent pixels. Pass it to whiteBalance to make that spot neutral gray. Null when every pixel there is transparent or the point is outside the image.

      Parameters

      Returns RGBValues | null

      canvas.onclick = (e) => {
      const [r, g, b] = sampleColor(image, e.offsetX, e.offsetY) ?? [0.5, 0.5, 0.5];
      p = p.set('whiteBalance', { r, g, b });
      };