Shader Edit Help: 2D Outline Coloring

Hi everyone. Below is an Shadow outline shader for 2D Textures and Sprites.
Could someone add in a variable to change the color of the texture outline?
Tried adding in _Color but placement give me an error. Your help is appreciated.


Shader "Custom/Outline_2DSprite" {
    Properties 
    {
        _MainTex ("Base (RGB)", 2D) = "white" {}
        _OutLineSpread ("Outline Spread", Range(0,0.012)) = 0.007
    }
 
    SubShader
 
    {
        Tags {"Queue"="Transparent" "IgnoreProjector"="True" "RenderType"="Transparent"}
        ZWrite On Blend One OneMinusSrcAlpha Cull Off
        LOD 110
 
        CGPROGRAM
        #pragma surface surf Lambert alpha
 
        struct Input 
        {
            float2 uv_MainTex;
            fixed4 color : COLOR;
        };
 
        sampler2D _MainTex;
        float _OutLineSpread;
 
        void surf(Input IN, inout SurfaceOutput o)
        {
            fixed4 mainColor = (tex2D(_MainTex, IN.uv_MainTex+float2(_OutLineSpread,_OutLineSpread)) + tex2D(_MainTex, IN.uv_MainTex-float2(_OutLineSpread,_OutLineSpread))) * fixed4(0,0,0,1);
            fixed4 addcolor = tex2D(_MainTex, IN.uv_MainTex) * IN.color;
 
            if(addcolor.a > 0.95){
            mainColor = addcolor;}
 
            o.Albedo = mainColor.rgb;
            o.Alpha = mainColor.a;
        }
        ENDCG       
    }
 
    SubShader 
    {
       Tags {"Queue"="Transparent" "IgnoreProjector"="True" "RenderType"="Transparent"}
        ZWrite Off Blend One OneMinusSrcAlpha Cull Off Fog { Mode Off }
        LOD 100
        Pass {
            Tags {"LightMode" = "Vertex"}
            ColorMaterial AmbientAndDiffuse
            Lighting On
            SetTexture [_MainTex] 
            {
                Combine texture * primary double, texture * primary
            }
        }
    }
    Fallback "Diffuse", 1
}

Shader “Custom/Outline_2DSprite”
{
Properties
{
_MainTex (“Base (RGB)”, 2D) = “white” {}
_OutLineSpreadX (“Outline Spread”, Range(0,0.012)) = 0.007
_OutLineSpreadY (“Outline Spread”, Range(0,0.012)) = 0.007
_Color(“Outline Color”, Color) = (1.0,1.0,1.0,1.0)
}

     SubShader
  
     {
         Tags {"Queue"="Transparent" "IgnoreProjector"="True" "RenderType"="Transparent"}
         ZWrite On Blend One OneMinusSrcAlpha Cull Off
         LOD 110
  
         CGPROGRAM
         #pragma surface surf Lambert alpha
  
         struct Input 
         {
             float2 uv_MainTex;
             fixed4 color : COLOR;
         };
  
         sampler2D _MainTex;
         float _OutLineSpreadX;
		 float _OutLineSpreadY;
		 float4 _Color;
  
         void surf(Input IN, inout SurfaceOutput o)
         {
             fixed4 mainColor = (tex2D(_MainTex, IN.uv_MainTex+float2(_OutLineSpreadX,_OutLineSpreadY)) + tex2D(_MainTex, IN.uv_MainTex-float2(_OutLineSpreadX,_OutLineSpreadY))) * _Color.rgba;
             fixed4 addcolor = tex2D(_MainTex, IN.uv_MainTex) * IN.color;
  
             if(addcolor.a > 0.95){
             mainColor = addcolor;}
  
             o.Albedo = mainColor.rgb;
             o.Alpha = mainColor.a;
         }
         ENDCG       
     }
  
     SubShader 
     {
        Tags {"Queue"="Transparent" "IgnoreProjector"="True" "RenderType"="Transparent"}
         ZWrite Off Blend One OneMinusSrcAlpha Cull Off Fog { Mode Off }
         LOD 100
         Pass {
             Tags {"LightMode" = "Vertex"}
             ColorMaterial AmbientAndDiffuse
             Lighting off
             SetTexture [_MainTex] 
             {
                 Combine texture * primary double, texture * primary
             }
         }
     }
     Fallback "Diffuse", 1
 }

Better late than never, but here ya go!

This doesn’t compile anymore in Unity 5.0.

I was able to get it somewhat working by changing the line

fixed4 AlphaColor = (0,0,0,TempColor`.a);

to

fixed4 AlphaColor = fixed4(TempColor.a,TempColor.a,TempColor.a,TempColor.a);

I’m not totally sure what changed between unity 4.6 and 5.0 and if my change is even a good one.