Assigning three colors to a curve in ParametricPlot3D using PlotStyle?

Why does this not work?

ParametricPlot3D[{t, t, t}, {t, 0, 3},  PlotStyle -> {If[1 <= t <= 2, Red, Green]}]

Hi Mariano,

You need to use a ColorFunction to do that. e.g.

ParametricPlot3D[{t, t, t}, {t, 0, 3}, 
 ColorFunction -> Function[{x, y, z, u}, If[Between[x, {1, 2}], Red, Green]],
 ColorFunctionScaling -> False]

Hi Rohit
Thank you for your help.