# Can't change color of vtkParametricFunction generated object

**URL:** https://discourse.vtk.org/t/cant-change-color-of-vtkparametricfunction-generated-object/8034
**Category:** Development
**Created:** [March 11, 2022, 3:42pm UTC](https://discourse.vtk.org/t/cant-change-color-of-vtkparametricfunction-generated-object/8034 "2022-03-11T15:42:43Z")
**Posts on this page:** 2
**Page:** 1

<div class="post-metadata">

### Author: ![niebrueg](https://discourse.vtk.org/letter_avatar_proxy/v4/letter/n/3bc359/32.png) [@niebrueg](https://discourse.vtk.org/u/niebrueg)
#### Post date: [March 11, 2022, 3:42pm UTC](https://discourse.vtk.org/t/cant-change-color-of-vtkparametricfunction-generated-object/8034/1 "2022-03-11T15:42:43Z")

</div>

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?

---

<div class="post-metadata">

### Author: ![amaclean](https://discourse.vtk.org/user_avatar/discourse.vtk.org/amaclean/32/224_2.png) [@amaclean](https://discourse.vtk.org/u/amaclean)
#### Post date: [March 12, 2022, 4:47am UTC](https://discourse.vtk.org/t/cant-change-color-of-vtkparametricfunction-generated-object/8034/2 "2022-03-12T04:47:33Z")

</div>

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](https://kitware.github.io/vtk-examples/site/Cxx/#parametric-objects).

This is pretty old, it used to be on the Kitware Site but has vanished, but is still here: [ParametricSurfaces](https://cupdf.com/document/parametricsurfaces.html)
