Hi Paul, What you could do is create a template palette file with colour decided by values (RGB_Mapping By_value) and write a small script which takes the upper/lower bounds you want and fills them in. The substitution command can be issued via the spawn command. Say we have dummy_template.spk ------------ RGB_Mapping By_value ! Red/White/Blue template LO 100 0 0 -0.001 100 100 100 0.001 100 100 100 HI 0 0 100 ------------ A little bit of sed... yes? sp "sed -s 's/LO/-2/;s/HI/5/' <dummy_template.spk > red_white_blue.spk" yes? sp cat red_white_blue.spk RGB_Mapping By_value ! Red/White/Blue template -2 100 0 0 -0.001 100 100 100 0.001 100 100 100 5 0 0 100 In general you can use symbols to make this clearer yes? def sym loval = -2 yes? def sym hival = 5 yes? sp "sed -s 's/LO/($loval)/;s/HI/($hival)/' <dummy_template.spk > red_white_blue.spk" Even better put the spawn command and symbol definitions into a ferret script along with a few other commands and it can even adjust the middle values or you can adjust multiple levels of a palette and all you'll ever need to do is issue a command like go make_rwb_palette -2 5 Cheers, Russ On 20/11/14 04:45, Paul Goddard wrote:
|