Change Color Associated with Transparency?
Let's say you have an image with an alpha channel:



Which in turn, is nothing but a mask: an image with a black and white channel that determines the opacity of the RGB information. Black (0) is considered transparent, white (1) opaque.



If one were to use the image as color for the texture we get an opaque texture, because the alpha channel is not being used, just the RGB information.



Adding a transparent shader and using the alpha information to control the mix will make the black (0) pixels of the alpha channel be transparent and the white ones opaque (1).



If you don't want to use the color information of the image, but want to keep the mask to control the transparency, then just set the color of the shader to whatever color you want and use the alpha channel to determine the mix with a transparent shader.



If your image has no alpha channel you could still use the color information as mask:

In this case, since the mask information is in the blue channel, you can use any of the other two channels (red or green) to determine the mix between diffuse and transparent.





But your confusion is coming from thinking of transparency.

If what you want to do is mix colors (with no shader being transparent) then use the image as mask to mix colors.