How to apply mix colors in curves?
Using Cycles, you can obtain this on a curve:



The material node setup is the following:


1- From texture coordinate input node use UV

2- Separate the UV coordinates

3- Keep the 'U' (= X) coordinate and set it as input in a color ramp (add the wanted colors to it)

4/5- Set the result in your shader

Finally, go to the curve properties and set the texture space to use 'UV for mapping'. 'U' (=X) is along the curve and 'V' (=Y) is transversal to the curve.