Making a color transparent in shaders

I have this shader that I have written. I have a 2d rectangular sprite, no textures. If the left side of the sprite is 0 and the right end of the sprite is 1, I am interpolating through and calculating its position within the sprite, and color it accordingly. If it goes out the range, I want to make it transparent. This is what I currently have for the pixel shader.

Shader "Custom/rangeColorShader"
    _RangeColor3("RangeColor3", Color) = (1, 0, 0, 1)
    _RangeColor2("RangeColor2", Color) = (1, 0, 0, 1)
    _RangeColor1("RangeColor1", Color) = (1, 0, 0, 1)

    _StartXPos("StartXPos", Float) = 1.5
    _EndXPos("EndXPos", Float) = 1.5

    _Bad("Bad", Range(0.0, 1.0)) = 0.5
    _Good("Good", Range(0.0, 1.0)) = 0.5

      Tags{ "Queue" = "Transparent" "RenderType" = "Transparent" }
      Blend SrcAlpha OneMinusSrcAlpha

        #pragma enable_d3d11_debug_symbols
        #pragma vertex vert             
        #pragma fragment frag

        struct vertInput
          float4 pos : POSITION;

        struct vertOutput
          float4 pos : SV_POSITION;
          float3 wPos : TEXCOORD1;

        vertOutput vert(vertInput input)
          vertOutput o;
          o.pos = mul(UNITY_MATRIX_MVP, input.pos);
          o.wPos = mul(_Object2World, input.pos).xyz;
          return o;

        float _StartXPos;
        float _EndXPos;

        float4  _RangeColor3;
        float4  _RangeColor2;
        float4  _RangeColor1;

        float _Good;
        float _Bad;

        float4  frag(vertOutput output) : COLOR
          float pos = (output.wPos.x - _StartXPos) / (_EndXPos - _StartXPos);

          if (pos < _Bad)
             return half4(_RangeColor1.r, _RangeColor1.g, _RangeColor1.b, 1.0f);
          else if (pos < _Good)
             return half4(_RangeColor2.r, _RangeColor2.g, _RangeColor2.b, 1.0f);
          else if (pos <= 1.0f)
             return half4(_RangeColor3.r, _RangeColor3.g, _RangeColor3.b, 1.0f);
          else //for debugging purpose 
             return half4(1.0, 1.0, 1.0, 1.0);

    FallBack "Diffuse"

I thought setting the alpha to 0 would make it transparent, but when it hits the else statement, it just goes black. It does not show the color behind the sprite (which is purple). Is my approach to making a section go transparent incorrect?

Edit: Posted my entire shader code.
Edit #2: Anyone??

You didn’t include the shader’s Tags and Render State Setup in the question, which is important to know for transparency. Did you update the tags and enable alpha blending?

 Tags { "Queue"="Transparent" "RenderType"="Transparent" }
 Blend SrcAlpha OneMinusSrcAlpha