Can't change color of vtkParametricFunction generated object

I’m generating a custom parametric object and it always draws as black regardless of what I try. I want to color it based on the distance from the origin.

I’ve tried SetScalarModeToDistance on the Parametric Function Source object and ScalarVisibilityOn on my vtkPolyDataMapper.

Are there any examples that could help guide me through this?

If it is always black I suspect that, when you are generating the triangulation, the order of the vertices is wrong.

This will give you a few examples using the provided VTK parametric sources: parametric-objects.

This is pretty old, it used to be on the Kitware Site but has vanished, but is still here: ParametricSurfaces