From: John Stone (johns_at_ks.uiuc.edu)
Date: Thu Oct 14 2010 - 11:54:04 CDT

Hi,
  No, you can't currently set the color as an RGB tuple
(in either Tcl or Python). You can set it to a color index,
and define the color scale as you like using the scripting APIs however.

Cheers,
  John Stone
  vmd_at_ks.uiuc.edu

On Thu, Oct 14, 2010 at 05:37:10PM +0100, Brooke Dallas wrote:
> Dear Axel,
> Is it possible to set the current color using an RGB 3-tuple in Tcl?
> For example,
> "graphics top color red"
> "graphics top sphere {1 1 1}
> or
> "graphics top color 2"
> "graphics top sphere {1 1 1}"
> draws red and gray spheres, but can I say something like
> "graphics top color {0.5 0.0 0.5}" ?
> If I am reading the manual right it looks like this is possible in Python,
> but not Tcl,
> can that be right?
> thanks
>
> Brooke
>
> On Wed, Oct 13, 2010 at 6:38 PM, Axel Kohlmeyer <akohlmey_at_gmail.com>
> wrote:
>
> On Wed, Oct 13, 2010 at 12:31 PM, Brooke Dallas <bdallas_at_ucdavis.edu>
> wrote:
> > Thanks Axel,
> >
> > The molecule has 38 atoms and it only needs to be a static image.
>
> ok. then the kind of approaches i have in mind, should work for you.
> it will need a little tcl scripting, but not too much.
>
> option 1:
>
> re-draw all bonds manually using the cylinder primitive.
> you need to get a list of all bonds, match them with the
> value that you want to attach to them, identify the coordinates
> of the atoms and then draw the bond after setting the color
> to a proper value.
>
> option 2:
>
> create 4 representations that use coloring by user, user2, user3, user4
> then identify the bonds and set the user field for both atoms to the
> rmsf value. if user is != 0 for any of the two atoms use user2 instead,
> if that is set then use user3 and so on. if you use a "Bonds"
> representation
> you can overlay it with a CPK or scaled down VDW representation to
> show the atoms in their "normal" colors.
>
> perhaps you can try with a couple of bonds manually, which of
> the two options would be more convenient and let us know if
> you run into problems with the implementation.
>
> cheers,
> axel.
>
> >
> > Brooke
> >
> > On Wed, Oct 13, 2010 at 3:41 PM, Axel Kohlmeyer <akohlmey_at_gmail.com>
> wrote:
> >>
> >> On Wed, 2010-10-13 at 14:46 +0100, Brooke Dallas wrote:
> >> > Dear Vmd List,
> >>
> >> dear brooke,
> >>
> >> > I need to draw a molecule with bond colors indicating the RMS bond
> >> > length fluctuation for each bond, e.g. blue for small RMS
> fluctuations
> >> > continuous to red for large RMS fluctuations. Does anybody have any
> >> > suggestions for how to do that?
> >>
> >> how large a molecule?
> >> does it have to be dynamics or only a static image?
> >>
> >> VMD doesn't have any internal provisions for things like this,
> >> so you would either have to do some kind of hack with multiple
> >> representations, or draw the bonds manually from a script.
> >>
> >> if you can give some more details about what you want to
> >> achieve and for what purpose you need this, somebody may
> >> be able to come up with some suggestions for doing this.
> >>
> >> cheers,
> >> axel.
> >>
> >> > Thanks in advance,
> >> >
> >> > Brooke Dallas
> >>
> >> --
> >> Dr. Axel Kohlmeyer akohlmey_at_gmail.com
> >> http://sites.google.com/site/akohlmey/
> >>
> >> Institute for Computational Molecular Science
> >> Temple University, Philadelphia PA, USA.
> >>
> >
> >
>
> --
> Dr. Axel Kohlmeyer akohlmey_at_gmail.com
> http://sites.google.com/site/akohlmey/
>
> Institute for Computational Molecular Science
> Temple University, Philadelphia PA, USA.

-- 
NIH Resource for Macromolecular Modeling and Bioinformatics
Beckman Institute for Advanced Science and Technology
University of Illinois, 405 N. Mathews Ave, Urbana, IL 61801
Email: johns_at_ks.uiuc.edu                 Phone: 217-244-3349
  WWW: http://www.ks.uiuc.edu/~johns/      Fax: 217-244-6078