multicoulor emitter

Hi everyone
Been lurking and reading alot of the forums here and enjoying what I am learning.
have come across something that I havn’t been able to find an answer for and helping someone may have ideas on how to achieve it.
As an example I have 2 objects 1 red and 1 blue with a glass cylinder running between them, inside this cylinder I have a much thinner cylinder that I wish to use as an emission object. Now what I am trying to achieve is where this cylinder attaches to the red object I wish it to emit red light and at the blue object emit blue light and then gradually ramp down to the centre of the cylinder where the light is white.

                 ____________________________________________________
                l____________________________________________________l

                 Red-------ramp down--------white--------ramp down-------Blue

Thanks Incantrix

If I got you right, you simply need to use a gradient texture node and a color ramp node (and some vector nodes top map it) :


Thanks Chameleon Scales
I was working a similar layout but didn’t even think about using a mapping node. As all I was getting was a solid change red to white to blue.
Will set this up now and see how I go.
Thankyou again

Incantrix