Hi,

some helper functions

Alexander



function defineListColorScheme( colorList, schemeName, nStep, asHsl ){
    var colorStr = color( colorList[1], colorList[2], nStep, asHsl );
    for( var i=2; i<colorList.size; ++i ){
        colorStr += color( colorList[i], colorList[i+1], nStep, asHsl )[10][0];
    }
    color @{ schemeName + "=" + colorStr }
}

defineListColorScheme(["blue", "white", "green", "orange"], "chainedScheme", 
16, true);

color {*} property temperature "chainedScheme";

 

function defineHueColorScheme( schemeName, n, saturation, luminosity ){
    var colorStr = "";
    var step = 360.0/n;
    for ( var i = 0; i <=360; i+=step ){
        colorStr += color( "toRGB", point(i, saturation, luminosity) ).color;
    }
    color @{ schemeName + "=" + colorStr }
}

defineHueColorScheme( "hueScheme", 120, 60, 100 );

color {*} property atomindex "hueScheme";



----- Ursprüngliche Mail -----
> Von: "Robert Hanson" <hans...@stolaf.edu>
> An: jmol-users@lists.sourceforge.net
> Gesendet: Dienstag, 25. Februar 2014 21:28:59
> Betreff: Re: [Jmol-users] user defined color scheme
> 
> 
> 
> absolutely! You could chop off the second white with:
> 
> color @{ "hslChain="+color("red", "white", 50, true) + color("white",
> "blue", 50, true)[10][0] }
> 
> 
> 
> 
> On Tue, Feb 25, 2014 at 2:04 PM, Alexander Rose <
> alexander.r...@weirdbyte.de > wrote:
> 
> 
> Hi Bob,
> 
> chaining should work or? haven't tried it.
> 
> color @{ "hslChain="+color("red", "white", 50, true) + " " +
> color("white", "blue", 50, true) };
> 
> That is quite flexible. A caveat is white occurs twice. But for large
> n it is probably negligible.
> 
> 
> 
> Alexander
> 
> 
> 
> ----- Ursprüngliche Mail -----
> > Von: "Robert Hanson" < hans...@stolaf.edu >
> > An: jmol-users@lists.sourceforge.net
> > Gesendet: Dienstag, 25. Februar 2014 20:45:30
> 
> > Betreff: Re: [Jmol-users] user defined color scheme
> > 
> > 
> > 
> > 
> 
> 
> > I did not know how cool HSL is. Pretty amazing!
> > 
> > http://chemapps.stolaf.edu/jmol/zip/jmol-14.1.11_2014.02.25.zip
> > 
> > also fixes the state business.
> > 
> > 
> > 
> > 
> > 
> > On Tue, Feb 25, 2014 at 1:24 PM, Robert Hanson < hans...@stolaf.edu
> > >
> > wrote:
> > 
> > 
> > 
> > 
> > How's this?
> > 
> > ___JmolVersion="14.1.11_2014.02.25"
> > 
> > new feature: color(color1, color2, n, asHSL)
> > -- returns a color scheme as a string
> > -- colors can be of any nature -- string or point, name or rgb
> > -- n colors; simple interpolation from color1 to color2
> > -- asHSL must be TRUE or FALSE;
> > -- when TRUE, uses hue/saturation/luminance instead of rgb gradient
> > 
> > -- example:
> > 
> > $ print color("white", "red", 5, false)
> > 
> > [xffffff][xffbfbf][xff7f7f][xff3f3f][xff0000]
> > 
> > $ print color("red", "blue", 5, true)
> > 
> > [xff0000][xffff00][x00ff00][x00ffff][x0000ff]
> > 
> > $ set propertyColorScheme color("yellow","black",50,true)
> > $ color property temperature
> > 
> > Bob
> > 
> > 
> > 
> > 
> > 
> > 
> > 
> > If nature does not answer first what we want,
> > it is better to take what answer we get.
> > 
> > -- Josiah Willard Gibbs, Lecture XXX, Monday, February 5, 1900
> > 
> > 
> > 
> > 
> > --
> > 
> > Robert M. Hanson
> > Larson-Anderson Professor of Chemistry
> > St. Olaf College
> > Northfield, MN
> > http://www.stolaf.edu/people/hansonr
> > 
> > 
> > If nature does not answer first what we want,
> > it is better to take what answer we get.
> > 
> > -- Josiah Willard Gibbs, Lecture XXX, Monday, February 5, 1900
> > 
> > 
> 
> 
> > ------------------------------------------------------------------------------
> > Flow-based real-time traffic analytics software. Cisco certified
> > tool.
> > Monitor traffic, SLAs, QoS, Medianet, WAAS etc. with NetFlow
> > Analyzer
> > Customize your own dashboards, set traffic alerts and generate
> > reports.
> > Network behavioral analysis & security monitoring. All-in-one tool.
> > http://pubads.g.doubleclick.net/gampad/clk?id=126839071&iu=/4140/ostg.clktrk
> > _______________________________________________
> > Jmol-users mailing list
> > Jmol-users@lists.sourceforge.net
> > https://lists.sourceforge.net/lists/listinfo/jmol-users
> > 
> 
> ------------------------------------------------------------------------------
> Flow-based real-time traffic analytics software. Cisco certified
> tool.
> Monitor traffic, SLAs, QoS, Medianet, WAAS etc. with NetFlow Analyzer
> Customize your own dashboards, set traffic alerts and generate
> reports.
> Network behavioral analysis & security monitoring. All-in-one tool.
> http://pubads.g.doubleclick.net/gampad/clk?id=126839071&iu=/4140/ostg.clktrk
> _______________________________________________
> Jmol-users mailing list
> Jmol-users@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/jmol-users
> 
> 
> 
> --
> 
> Robert M. Hanson
> Larson-Anderson Professor of Chemistry
> St. Olaf College
> Northfield, MN
> http://www.stolaf.edu/people/hansonr
> 
> 
> If nature does not answer first what we want,
> it is better to take what answer we get.
> 
> -- Josiah Willard Gibbs, Lecture XXX, Monday, February 5, 1900
> 
> 
> ------------------------------------------------------------------------------
> Flow-based real-time traffic analytics software. Cisco certified
> tool.
> Monitor traffic, SLAs, QoS, Medianet, WAAS etc. with NetFlow Analyzer
> Customize your own dashboards, set traffic alerts and generate
> reports.
> Network behavioral analysis & security monitoring. All-in-one tool.
> http://pubads.g.doubleclick.net/gampad/clk?id=126839071&iu=/4140/ostg.clktrk
> _______________________________________________
> Jmol-users mailing list
> Jmol-users@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/jmol-users
>

------------------------------------------------------------------------------
Flow-based real-time traffic analytics software. Cisco certified tool.
Monitor traffic, SLAs, QoS, Medianet, WAAS etc. with NetFlow Analyzer
Customize your own dashboards, set traffic alerts and generate reports.
Network behavioral analysis & security monitoring. All-in-one tool.
http://pubads.g.doubleclick.net/gampad/clk?id=126839071&iu=/4140/ostg.clktrk
_______________________________________________
Jmol-users mailing list
Jmol-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/jmol-users

Reply via email to