How to make the intersection area transparent if they have the same color?

There are several sprites of shapes in different colors.
I can move these shapes. When I move them, I want the intersection of two shapes of the same color to become transparent.
As far as I understand, the only right way is to write a shader.

I tried to write this shader. Here he is

Shader "ddShaders/dd_AddColor" {
	Properties
    {
        _Color ("Tint Color", Color) = (1,1,1,1)
    }

    SubShader
    {
        Tags 
		{ 
		"Queue"="Transparent"	
		}
		Cull Off
        Lighting Off
        ZWrite Off
        Fog { Mode Off }

		Blend OneMinusDstColor OneMinusSrcColor 
        BlendOp Add
       
        Pass
        {
       
			CGPROGRAM
			#pragma vertex vert
			#pragma fragment frag
			uniform float4 _Color;
			#include "UnityCG.cginc"
 
			struct vertexInput
			{
				fixed4 vertex: POSITION;
				fixed4 color : COLOR;  
			};
 
			struct fragmentInput
			{
				fixed4 pos : SV_POSITION;
				fixed4 color : COLOR0;
			};
 
			fragmentInput vert( vertexInput i )
			{
				fragmentInput o;
				o.pos = UnityObjectToClipPos(i.vertex);
				o.color = _Color;
				return o;
			}
 
			half4 frag( fragmentInput i ) : COLOR
			{
				
				return i.color;
			}
 
			ENDCG
		}
	}
}

But he does not make the intersection area transparent, but only makes an illusion. More specifically, the intersection area takes the background color. Therefore, if I have another object that is behind these shapes on another layer, then it will not be visible. Here is the result:
148987-5.png

But I want this:148988-55.png

Hi Novosadvitalya,

Although I couldn’t solve your problem but many thanks to you for your intersection transparent shader code. I really needed that. I appreciate it and I hope you have found the solution to your problem by now.