How to use color ramp with torus
This type of material is super easy to do in cycles. First break down what you want to do.


You want to have a gradient (three color stops).
You want the gradient running along the Z axis.


With that as our objective, we don't even need to touch any UV mapping.

Start by getting a gradient running in the direction you want (Z axis).
There are several ways to do this, but I like to simply split the generated texture coordinates, and use the Z component. That is the gradient, no other nodes needed.  

All that is left to do is run that (think of it as the direction data) in to a color ramp node to colorize it the way you want.

You can do all that with a Separate XYZ node plugged in to the Generated socket of a Texture Coordinate node. Then take the Z output of the Separate XYZ node and plug it in to the color ramp. (Like in the image below)