[vtkusers] vtkProperty , color setting problem
Francois Bertel
francois.bertel at kitware.com
Wed Jul 30 11:04:09 EDT 2008
Colors components are expressed/normalized between 0.0 (min) and 1.0 (max).
Just divide your values by 255.0.
On Wed, Jul 30, 2008 at 10:19 AM, Shady Shidfar <shady_shidfar at yahoo.com> wrote:
> Hi Everyone,
>
> I'm having a wierd problem with vtkProperty. I create a line and specify a
> color for it. The problem is that some (actually most) RGB values I pass to
> vtkProperty won't generate the related colour. say for example slateblue
> identified by R=147, G=112 and B=219
> (http://www.ecrion.com/Support/Resources/XSL-FOTutorial/ApendixA.xml.html)
> appears as white?????!!!!!!! and it's not only that color. Can someone tell
> me what's the solution the create any RGB color. Here's my code:
>
>
> vtk.
>
> vtkLineSource line = new vtkLineSource();
>
> line.SetPoint1(0.0, 0.0, 0.0);
>
> line.SetPoint2(50, 50, 0.0);
>
>
>
> vtkPolyDataMapper mapper = new vtkPolyDataMapper();
>
> mapper.SetInput(line.GetOutput());
>
>
>
> vtkActor lineActor = new vtkActor();
>
> lineActor.SetMapper(mapper);
>
>
>
> //set line properties
>
> vtkProperty property = new vtkProperty();
>
> property.SetColor(147.0, 112.0, 219.0);
>
> lineActor.SetProperty(property);
>
> ________________________________
> Not happy with your email address?
> Get the one you really want - millions of new email addresses available now
> at Yahoo!
> _______________________________________________
> This is the private VTK discussion list.
> Please keep messages on-topic. Check the FAQ at:
> http://www.vtk.org/Wiki/VTK_FAQ
> Follow this link to subscribe/unsubscribe:
> http://www.vtk.org/mailman/listinfo/vtkusers
>
>
--
François Bertel, PhD | Kitware Inc. Suite 204
1 (518) 371 3971 x113 | 28 Corporate Drive
| Clifton Park NY 12065, USA
More information about the vtkusers
mailing list