How can you use color ramp to affect emissive shader
That can be done using the geometry input node and doing that you'll have to tune the Z value depending on the object geometry:



The node math is done this way, as in this example Z is going from -1 to +1. So dividing by 2 obtains something between -0.5 and +0.5 and add 0.5 obtains something between 0 and 1 which is what we want for the colorramp.

You can also use a UV map (to avoid geometric calculation). For instance make the UV map with 'project from view (bounds)', so that you can: