selective color correction
For simple channel switching, use the separate RGB node. That will give you access to individual channels.

To turn green into blue, and blue into green, just switch the channels so that the the green channel output goes to the blue input of a Combine RGB node, and the blue channel goes to the green input.


(click on the image to display in full screen)

Colors that have values in more than one channel will of course be affected.

For more selective changes you need to do some channel math and use masks to limit the transformation ...

To turn yellow into red:

Yellow is composed of green and red, so add those channels (using a mix RGB will allow you to choose the right amount of each channel information), then subtract blue channel, and plug the result to a color ramp to further isolate tones. The idea is to generate a black and white image (a mask) that contains only the area of the color range that you want to affect.



Use the mask, to combine other colors in an RGB mix node. This is done by plugging the output of the channel processing to the Fac input of a color mix node. This example shows how the isolated yellow square mask is used to add red just to that section, without affecting other colors:



A slightly different approach would be to use the mask to affect the original image through a Hue Saturation Value node. The mask should be plugged to the Fac input of the node. Again, changes on the HSV values would only affect the area determined by the mask.



To do several corrections, create multiple masks and use them to mix other colors or control HSV adjustments.  As an example: yellow turned into red, green into blue and blue into green.







The compositor has more intuitive and powerful tools to do selective shifts using the Color>Hue Correct node. 

In Hue mode you can select a narrow band of color and turn it into a different hue.