<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
  <meta content="text/html;charset=ISO-8859-1" http-equiv="Content-Type">
  <title></title>
</head>
<body bgcolor="#ffffff" text="#000000">
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.<br>
<br>
JB<br>
<br>
<br>
Kanghong Li wrote:
<blockquote cite="mid001201c503c1$14e2b360$8901a8c0@SUN" type="cite">
  <meta http-equiv="Content-Type" content="text/html; ">
  <meta content="MSHTML 6.00.2800.1106" name="GENERATOR">
  <style></style>
  <div><font face="Arial" size="2">I am trying to convert from the RGBA
values returned from Java JColorChooser to an index in the vtk lookup
table. Somehow the following</font></div>
  <div><font face="Arial" size="2">conversion:</font></div>
  <div><font face="Arial" size="2">0.<font face="Times New Roman"
 size="3">299*R + 0.587*G + 0.114*B or A*(0.299*R + 0.587*G + 0.114*B).<br>
  <font face="Arial" size="2">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.</font></font></font></div>
  <div>&nbsp;</div>
  <div><font face="Arial" size="2">Anyone knows what could cause the
problem? Any solutions? Thanks.</font></div>
  <pre wrap="">
<hr size="4" width="90%">
_______________________________________________
This is the private VTK discussion list. 
Please keep messages on-topic. Check the FAQ at: <a class="moz-txt-link-freetext" href="http://www.vtk.org/Wiki/VTK_FAQ">http://www.vtk.org/Wiki/VTK_FAQ</a>
Follow this link to subscribe/unsubscribe:
<a class="moz-txt-link-freetext" href="http://www.vtk.org/mailman/listinfo/vtkusers">http://www.vtk.org/mailman/listinfo/vtkusers</a>
  </pre>
</blockquote>
<br>
</body>
</html>