Convert colors: BGR to RGB

[FONT=Arial][SIZE=2]I’ve searched a few times, but I can’t seem to find how to reverse this formula which takes Visual Basic’s BGR format and turns it into RGB:

var RGB = (color & 0x000000ff) << 16  | (color & 0x0000FF00) | (color & 0x00FF0000) >> 16

I need to take the RGB and turn it into BGR to feed into VB.
I’m sure it’s a simple bitwise operation, but I keep getting weird effects, like blue turns to green when it converts. I really appreciate any advice!

[/SIZE][/FONT]