I’m assuming you’re using the Expression node in Nuke to do that. That’s an entirely different beast than AE expressions and is used for a different purpose.
However, the example you posted can be done by clever use of effects, blend modes and pre-composing.
In the specific case you mentioned you could use Shift Channels to bring the Red into each of the RGB channels, use Levels to multiply the values by 1.5 (set the output white to 1.5), use Shift Channels on a duplicate to bring the Green into the RGB channels, put that duplicate above the Red and set it’s blend mode to Divide, create a new solid at the top of the timeline with RGB values of [0.8,0.8,0.8] and set it to the Multiply blend mode. You now have your alpha value, you just need to pre-compose it and use it as a matte.
Some of the details in the above method can be altered but the basic idea is the same as the expression node in Nuke. As far as computers are concerned the colors are just numbers. You can modify them with effects and blend modes the same way you would with mathematical operators. Several of the blend modes are named after mathematical operators (Add, Subtract, Multiply, Divide) for a reason!
Of course this should all be done in 32bpc (as Nuke does) to preserve values. It’s not as easy and certainly not as flexible as the Expression node (good luck finding “Square Root” or trigonometric blend modes) but the basics are definitely achievable.
Darby Edelen