I haven't tried after writing it, but this should work:

var mycolors = [red, orange, green];
var m = n + 1; // 'n' is your model count here
for (var i = 1; i < m; i = i + 1)
{
  select */i;
  color atoms mycolors[i % mycolors.size];
}

The 'i % mycolors.size' means that if you get to the end of your
colors list, it'll start reusing them from the beginning.

Note that you can specify colors in the form [r, g, b] as well, where
'r', 'g' and 'b' are values from 0 - 255.

Best,

Dave


2009/6/16 Marie-Christine Vallet <[email protected]>:
> Hi,
> I have a jmol window with n number of models and would like to color
> each of my models with a different color without having to select each
> model manually. I would like a script to do this automatically, is it
> possible? Did I miss something in the mailing list that would answer
> that question.
> Thanks,
> Marie
>
> ------------------------------------------------------------------------------
> Crystal Reports - New Free Runtime and 30 Day Trial
> Check out the new simplified licensing option that enables unlimited
> royalty-free distribution of the report engine for externally facing
> server and web deployment.
> http://p.sf.net/sfu/businessobjects
> _______________________________________________
> Jmol-users mailing list
> [email protected]
> https://lists.sourceforge.net/lists/listinfo/jmol-users
>



-- 

- N David Brown

------------------------------------------------------------------------------
Crystal Reports - New Free Runtime and 30 Day Trial
Check out the new simplified licensing option that enables unlimited
royalty-free distribution of the report engine for externally facing 
server and web deployment.
http://p.sf.net/sfu/businessobjects
_______________________________________________
Jmol-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/jmol-users

Reply via email to