Lookup top question

hey, i try to get my head around the lookup top, but im not even sure if this is the best solution for my problem.

my goal: i have image A, B and C. i would like to change the colors of C based on A and B. so if on image A the first pixels color is blue and on the same coordinate on B is green, then every blue pixel in C should be swapped for that green. (ofcourse it should be precise with proper color values.)

I’m not sure, can the lookup top do this? and with high precision so X color value gets replaced with Y value only?

or should i maybe do this in python and write a script that does this?

thanks in advance,
richard