[vtk-developers] Interest in a vtkColor class?

Mathieu Malaterre mathieu.malaterre at kitware.com
Mon Mar 21 08:39:48 EST 2005


Andrew,

	Basically what you are asking is to include by default:

	VTK/Common/Testing/Cxx/vtkTestingColors.h

	The solution of the hash seems a bit too elaborate since the colors are 
not supposed to change. So I would rather see a solution like 
vtkTestingColors.h.

My 2 cents,
Mathieu

Andrew Maclean wrote:
> Hi All,
> 
> Is there any interest in a vtkColor class? 
> 
> If so I would be happy to write one.
> 
> I envisage using the colour names in colors.tcl and having a function like:
> GetColor("red"); returning a float[3]. Most likely I would use a map as the
> underlying structure so that we could have a function like
> InsertColor(name,r,g,b); Thus users could add to the existing colour table.
> 
> I just find it frustrating that when using TCL I can easily specify a colour
> but I can't do this in C++. 
> 
> It would be nice to have something like:
> actor->GetProperty()->SetColor(color->GetColor("antique_white"));
> 
> 
> Of course local defines could be used but I think having a colour class
> along with the ability to add more colours as you want may be a better
> solution. I also want to keep the well known colour names without decorating
> them, hence the syntax above.
> 
> 
> Andrew
> 
> 
> 
> 
> ___________________________________________
> Andrew J. P. Maclean
> Centre for Autonomous Systems
> The Rose Street Building J04
> The University of Sydney  2006  NSW
> AUSTRALIA
> Ph: +61 2 9351 3283
> Fax: +61 2 9351 7474
> URL: http://www.cas.edu.au/
> ___________________________________________
> 
> 
> _______________________________________________
> vtk-developers mailing list
> vtk-developers at vtk.org
> http://www.vtk.org/mailman/listinfo/vtk-developers
> 




More information about the vtk-developers mailing list