Polyline section colors

Hello, so i’m a new trainee and for my company i’m studying vtk in order to replace their 3D component, and for that reason i need to display boreholes as polylines, but the fact is that they want me to color each section of a polyline by a different color, is there any method native in vtk to do this? Or am i forced to split each polyline into multiple lines to color each one separately ?
Thanks for any answer or advice that could helpme!

Use line cells instead of polylines cell.

How does it work? I mean have you got a link to some documentation i could read please? Thanks for the quick answer though!

here you go:

https://kitware.github.io/vtk-examples/site/Cxx/GeometricObjects/ColoredLines/

Thank you!