hasKonvaPixelColorAtPoint = ([x, y, rgbArray, tolerance]) => {
  const stage = window.Konva.stages[0];
  let result = false;

  const areEqualRGB = (a, b) => {
    for (let i = 3; i--; ) {
      if (Math.abs(a[i] - b[i]) > tolerance) {
        return false;
      }
    }
    return true;
  };

  for (const layer of stage.getLayers()) {
    const rgba = layer.getContext().getImageData(x, y, 1, 1).data;

    if (!areEqualRGB(rgbArray, rgba)) continue;

    result = true;
  }

  return result;
}
Check if there is layer with given color at given coords
@param {number} x
@param {number} y
@param {number[]} rgbArray
@param {number} tolerance