I want to draw lines as the opposite color as the background with alpha. How I do this?
Since this is fairly vague, I'm going to guess that you mean:
If the background is opaque green (0, 255, 0, 255), then I want to draw a semi-transparent purple line (255, 0, 255, 255/2) so that the actual pixels along the line post-blending would be (255/2, 255/2, 255/2). Likewise for any opaque background color.
Let the source color & alpha as "sc" and "sa". Likewise, "dc" and "da" for the destination.
According to my guess (and assuming I understand blend modes correctly), what you want to achieve is:
color = sa * (1 - dc) + (1 - sa) * dc
alpha = 1
All blend mode equations must fit this format:
color = (<factor> * sc) <operation> (<factor> * dc)
alpha = (<factor> * sa) <operation> (<factor> * da)
The alpha part is easy, but I do not believe there is any way to get that particular expression for color given the factors and operations available, mostly because you have no "source color" you want to blend with. So if I understood you correctly, what you want simply cannot be done using blend modes, and you'll have to do something else. What the "something else" should be depends on what your "background" is and how much you know about it upfront.
If all of this is wrong and you want something else entirely, please provide a less ambiguous description of what you want, ie something with screenshots/mockups or specific examples of what RGBA values you want to put in and get out.