I can't tell you how to do that in a shader, but I can at least explain the math.
Basically, all your objects have two textures: an RGB color texture (which in your example is just a solid color for each object) and a weight texture (which in your example is just a radial gradient). In practice, you could conveniently store the weight as the alpha component of a 4-component RGBA texture (although you won't be using it for normal alpha blending). Alternatively, for simple shapes and gradients like these, you can just calculate the weight for each object procedurally in your shader.
Now, to calculate the color of each pixel, you take the weighted average of the colors of the objects that overlap that pixel. That is, if object k has weight Wk and color Ck = (Rk, Gk, Bk), then you'd calculate:
Csum = (W1 * C1) + (W2 * C2) + (W3 * C3) + ...
Wsum = W1 + W2 + W3 + ...
and let the color of the pixel be Cavg = Csum / Wsum.
Note that you can avoid the multiplications in calculating Csum if you store the color channels premultiplied by the weight. Also note that it's possible for both Csum and Wsum to be zero, e.g. if no objects overlap a given pixel. In that case, you need to decide what color to use; your example picture appears to be using black for that case.