add color to curve and text

how an you add some colors mat to a curve and also to a textcurve object?

Thanks