How to modify the line color of LineWidget?

When using LineWidget for line measurement, there is no way to modify the color of the lines, and the colors of rectangles and circles are different from it.
How should I handle this issue?

First, prefer vtkLineWidget2 over `vtkLineWidget. Then use vtkLineRepresentation::GetLineProperty to access and change properties like color, line width, etc. for the line.