I guess that you are talking about equalization among the color channels, right? I mean, rescale the brightness of each color channel, so you have the right color balance, or neutralize the background.
Since you are working with linear data (CCD raw images, reducted [bias, darks, flats]), all you need is a linear function that rescales them. This means, multiply each one of them with a different constant value.
This is the PixelMath expression:
For each channel (not a single expression):
R: $T*A
G: $T*B
B: $T*C
where A is: Maximum of medians / Median of red channel
(and so on for B and C)
The median of each channel can be obtained with the ImageStatistics process (look for it at the Image category).
Another way to get it, in PixelMath is: Median($T[c]) where c is a number from 0 to 2, the channel (0 = Red, 1 = Green, 2 = Blue).
So, the first expression becomes:
R: $T*Max(Median($T[0],$T[1],$T[2]))/Median($T[0])
G: $T*Max(Median($T[0],$T[1],$T[2]))/Median($T[1])
B: $T*Max(Median($T[0],$T[1],$T[2]))/Median($T[2])
Hope this helps