Hi Bob,

Thank you very much for your answer! This last script solved my problem. It
is working pretty well. The function color("rgb",bmin, bmax, x.length) was
the tricky. Thanks also for all other previous suggestions!

All the best,

Max Pinheiro Jr

2017-01-19 16:04 GMT-02:00 Robert Hanson <[email protected]>:

> Yes, Max, there is a very simple way to do this. If you have a color
> scheme in mind, the color() function is what you want:
>
>
>
>
> *x = color(schemeName, min, max, value)*
>
> for example:
>
> $ x = color("rgb",0,2,1.5)
> $ print x
>
> {0.0 255.0 255.0}​
>
> bmin = {*}.bonds.length.min
> bmax = {*}.bonds.length.max
>
> Now you loop through the bonds, get the value of their length, and use
> that to deliver a color:
>
> load $caffeine
> bmin = {*}.bonds.length.min
> bmax = {*}.bonds.length.max
> for (var i = {*}.bonds.count; --i >= 0;) {
>   var x = eval("[{"+i + "}]")
>   select @x
>  color bonds @{color("rgb",bmin, bmax, x.length)}
> }
>
>
>
> ------------------------------------------------------------
> ------------------
> Check out the vibrant tech community on one of the world's most
> engaging tech sites, SlashDot.org! http://sdm.link/slashdot
> _______________________________________________
> Jmol-users mailing list
> [email protected]
> https://lists.sourceforge.net/lists/listinfo/jmol-users
>
>
------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most
engaging tech sites, SlashDot.org! http://sdm.link/slashdot
_______________________________________________
Jmol-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/jmol-users

Reply via email to