Created
January 22, 2021 18:44
-
-
Save mutterer/27bfa08f38e136e8bc0ce27a98716551 to your computer and use it in GitHub Desktop.
Random_color_picker_Tool.ijm
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 (a<min) a=min; | |
if (a>max) a=max; | |
return a; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment