Alpha blending problem?

I have created a Texture2D of a circle. color.Transparent is used outside the circle and color.White for the circle itself. I use a default spritebatch.Begin() and when I draw the Texture2D I pass in a tint color. I want the circle to take on the tint color when drawn. For opaque colors it works fine. I now want it to work for transparent colors too. What happens at the moment is that as the tint color gets more transparent the circle becomes more white but for tint A values over 127 then the circle drawn is almost black. (The tint color used is red (ARGB = A,255,0,0) and can vary A 0-255)
I’ve been playing around with different blend states without success. Also noticed that the default pixelshader is texture * color and so tried replacing color.White for the circle color with new color(1,1,1,1) but then don’t see anything. I’m guessing that because of the multiplication I need to premultiply the tint colour but failed with that too.
The logic I want is if the texture color is transparent then the output color is transparent. If the texture color is not transparent then the output color is the tint color.
Is there a “simple” way to have a Texture2D and be able to set it’s color to any desired color including transparent ones using the spritebatch color tint argument? I suppose the not simple way would be to write a pixelshader to do this but woud prefer not to!

Keep all states on default and remember one thing.

Color * Opacity

So lets say you have white texture (with 255 alpha) and you want red with 50% opacity. So for draw method you will use

Red * 0.5f

Thanks. I assume opacity is 1f - alpha ? So the tint will be 1f - alpha * color and apply that as a tint. I’ll give it a go and report back.

Have tried it and instead of going to white as alpha is reduced it’s going black. Will experiment though and see what I get…

Perhaps not 1- alpha then as have used color * alpha and it’s very close; for alphas 0-127 then it’s perfect and fades perfect;y but as before after 127 the color is a constant greyish/black color.

Solved! - Multiplying by alpha is the solution the issue I’m having when alpha is > 127 is a problem elsewhere.

This is, to me, a case where using non-premultiplied alpha makes a lot of sense. When starting your sprite batch, use
batch.Begin(blendState: BlendState.NonPremultiplied);

then the color passed in to your batch.Draw() call will work as you expected originally.

Thanks. I did try that but didn’t seem to be any different to the default spritebatch blend state. Just happy it’s working at the moment!