Nodes: How to set red and green channel smooth

Hello all. I’m learning Blender nodes.

What I’m trying to accomplish is this coordinate:


But the best I could get to is this:


Later, I will make my own model and then I’d like to render red + green channel like the 1st pic above. So, how exactly do I make it smooth?