[Gmsh] Help with View.ColorTable

James Zhou james at shapeways.com
Thu Jul 28 20:53:58 CEST 2011


Dear all,

I am having some trouble using View.ColorTable during post-processing.  My
understanding is that View.ColorTable is a list of 256 colors mapped
linearly from View.Min to View.Max.  Is that correct?  How to modify a
single entry in View.ColorTable?  I am trying to modified it in a loop like:

For i In {0:255}
    frac = i / 255.0;
    s = View[2].Min * (1-frac) + View[2].Max * frac;
    f = (s - min_v) / (max_v - min_v);
    f = (0 > f) ? 0 : f;
    f = (1 < f) ? 1 : f;
    View[2].ColorTable[i] = {f*255, (1-f)*255,
0};
EndFor

and it gives syntax error for using "[".  Thanks a lot!

James
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.geuz.org/pipermail/gmsh/attachments/20110728/71d38a42/attachment.html>