I have two 3 dimensional points. $A [x_1, y_1, z_1]$ and $B [x_2, y_2, z_2]$. I need to find a transformation matrix which when multiplied to $A$ will give me $B$ and when multiplied by $B$ give me $A$. The transformation needs to be a reflection against the plane that's perpendicular to the middle of the $AB$ segment and passing through the midpoint of the $AB$.
Sorry if I am not using the right terminology, I studied math 20 years ago so it's a little rusty.
Practical application of the question is to find a color matrix to swap two colors with arbitrary Red, Green and Blue components.
Thank you.

I actually figured it out.
Midpoint $C [x_c, y_c, z_c] = [ (x_1+x_2)/2, (y_1+y_2)/2, (z_1+z_2)/2 ]$.
Vector $AB [x_{ab}, y_{ab}, z_{ab}] = [ x_2-x_1, y_2-y_1, z_2-z_1 ]$.
Now, to find plane perpendicular to the vector intersecting the midpoint. Plane has canonical form $A_p*x + B_p*y + C_p*z + D_p = 0$ where $A_p, B_p, C_p$ describe the vector so they are equal to $x_{ab}, y_{ab}, z_{ab}$ and $D_p$ is $-x_{ab}*x_c-y_{ab}*y_c-z_{ab}*z_c$.
The reflection matrix is \begin{pmatrix} -2*A_p*A_p+1& -2*B_p*A_p& -2*C_p*A_p& 0 \\ -2*A_p*B_p& -2*B_p*B_p+1& -2*C_p*B_p& 0 \\ -2*A_p*C_p& -2*B_p*C_p& -2*C_p*C_p+1& 0 \\ -2*A_p*D_p& -2*B_p*D_p& -2*C_p*D_p& 1 \\ \end{pmatrix}
I realize it doesn't solve the impossible cases, but it works for me. Thanks.