# vtkDistanceWidget Individual Colors for Each End

**URL:** https://discourse.vtk.org/t/vtkdistancewidget-individual-colors-for-each-end/4239
**Category:** Support
**Created:** [September 17, 2020, 6:01pm UTC](https://discourse.vtk.org/t/vtkdistancewidget-individual-colors-for-each-end/4239 "2020-09-17T18:01:46Z")
**Posts on this page:** 2
**Page:** 1

<div class="post-metadata">

### Author: ![raungst](https://discourse.vtk.org/user_avatar/discourse.vtk.org/raungst/32/1965_2.png) [@raungst](https://discourse.vtk.org/u/raungst)
#### Post date: [September 17, 2020, 6:01pm UTC](https://discourse.vtk.org/t/vtkdistancewidget-individual-colors-for-each-end/4239/1 "2020-09-17T18:01:46Z")

</div>

I’m trying to use the vtkDistanceWidget as more of a vector widget to signify direction. To show the user which direction is from and to, I’m trying to set the color of each cross hair to something different. However, they seem to share the same property and I can’t figure out a way to make them different. Is there anyway to do this? Or a way to switch the axis to an arrow or something that would help make it a direction instead of just a measurement?

Thanks!

---

<div class="post-metadata">

### Author: ![Paulo\_Carvalho](https://discourse.vtk.org/user_avatar/discourse.vtk.org/paulo_carvalho/32/370_2.png) [@Paulo\_Carvalho](https://discourse.vtk.org/u/Paulo_Carvalho)
#### Post date: [September 18, 2020, 9:12pm UTC](https://discourse.vtk.org/t/vtkdistancewidget-individual-colors-for-each-end/4239/2 "2020-09-18T21:12:01Z")

</div>

Hello Robby,

`vtkDistanceWidget` has a method called `GetDistanceRepresentation()`, which returns a pointer to a `vtkDistanceRepresentation` object. `vtkDistanceRepresentation` has two methods called `GetPoint1Representation()` and `GetPoint2Representation()`. Both return pointers to `vtkHandleRepresentation` objects. A `vtkHandleRepresentation` allows to control the appearance of the handles. I didn’t find a simple way to change their colors that does not involve subclassing or hacking, but I suggest you to study the `vtkHandleRepresentation`'s API ([https://vtk.org/doc/nightly/html/classvtkHandleRepresentation.html](https://vtk.org/doc/nightly/html/classvtkHandleRepresentation.html)). Maybe you’ll find some other solution to visually distinguish both handles.

regards,

Paulo
