// This is a randon color picker too that uses the // Toolbar.setIcon() method, added in v1.53h. // To run, install and press the "Play Tool" button. // Author: Jerome Mutterer macro "Digit1 Action Tool - C037N44R00nn" {} macro "Digit2 Action Tool - C037N44R00nn" {} macro "Digit3 Action Tool - C037N44R00nn" {} macro "Play Action Tool - C037N44F0hf4 Fd64f Cf00 Va0bb " { call("ij.gui.Toolbar.setIcon", "Play Action Tool", "C037N44F0hf4 CfF0 Vadbb" ); wait(500); call("ij.gui.Toolbar.setIcon", "Play Action Tool", "C037N44F0hf4 Fd64f Cf00 Va0bb" ); for (i=0;i<10;i++) { r=floor(16*random()); g=floor(16*random()); b=floor(16*random()); call("ij.gui.Toolbar.setIcon", "Digit1 Action Tool", "N44 C000 O00nn Cf00 o11ll Cfff T7k20"+h(r) ); call("ij.gui.Toolbar.setIcon", "Digit2 Action Tool", "N44 C000 O00nn C0f0 o11ll Cfff T7k20"+h(g) ); call("ij.gui.Toolbar.setIcon", "Digit3 Action Tool", "N44 C000 O00nn C00f o11ll Cfff T7k20"+h(b) ); wait(50*i); } setForegroundColor(16*r, 16*g, 16*b); showStatus("Foreground color set to: "+Color.foreground); } function h(a) { return ""+toExtHex(constrain(a,0,23)); } function toExtHex(n) { if (n>15) return fromCharCode(0x66+n-15); else return toHex(n); } function constrain(a,min,max) { if (amax) a=max; return a; }