[vtkusers] Map RGBA from JColorChooser to an index in vtk default lookup table

John Biddiscombe jbiddiscombe at skippingmouse.co.uk
Wed Jan 26 11:12:06 EST 2005

Loop over each colour in the lookptable and compute the euclidian 
distance in RGB space between your colour and the colour in the lut. the 
one with the smallest distance is the closeszt match.


Kanghong Li wrote:

> I am trying to convert from the RGBA values returned from Java 
> JColorChooser to an index in the vtk lookup table. Somehow the following
> conversion:
> 0.299*R + 0.587*G + 0.114*B or A*(0.299*R + 0.587*G + 0.114*B).
> did not give me the right index to the vtk lut. In other words, the 
> color from lut did not match the one selected from the JColorChooser.
> Anyone knows what could cause the problem? Any solutions? Thanks.
>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:

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.vtk.org/pipermail/vtkusers/attachments/20050126/a884dd33/attachment.htm>

More information about the vtkusers mailing list