Quantcast
Channel: Adobe Community: Message List
Viewing all articles
Browse latest Browse all 154536

Re: How do create a script that chooses a random swatch?

$
0
0

Does this help?

// 2014, use it at your own risk;

#target photoshop-70.032

// set up colors;

var theArray = [

[0,0,0],

[255,0,0],

[0,255,0],

[0,0,255],

[255,255,255],

];

// select color;

var thisColor = theArray[Math.floor(Math.random()*(theArray.length))];

// make forground color;

var theColor = new SolidColor();

theColor.rgb.red = thisColor[0];

theColor.rgb.green = thisColor[1];

theColor.rgb.blue = thisColor[2];

app.foregroundColor = theColor;


Viewing all articles
Browse latest Browse all 154536

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>