What colors
Your color array could be created like this
var ColorArray = [color,color,color] where each color is a solid color variable. which are array that have three color values for example
textColor = new SolidColor;
textColor.rgb.red = 255;
textColor.rgb.green = 255;
textColor.rgb.blue = 255;
Once you have your color array its easy to get a random color from the array your fill color would be
(ColorArray[Math.floor(Math.random(ColorArray.length) * ColorArray.length)])
You need though to be careful when dealing with layers by name. Photoshop Document Layer Names are not required to be unique there can be more then one layer in a document with the same name.
Get the layer by name make it the activate layer select all and fill the selection with the color
app.activeDocument.selection.fill(ColorArray[Math.floor(Math.random(ColorArray.length) * ColorArray.length)]);
Creating an array of 10 random colors and picking one.
randomColor = new SolidColor;
randomColors = new Array();
for(var i = 0; i < 10; i++) {
randomColor.rgb.red = Math.round(Math.random() * 255);
randomColor.rgb.green = Math.round(Math.random() * 255);
randomColor.rgb.blue = Math.round(Math.random() * 255);
randomColors.push(randomColor);
}
pickone=randomColors[Math.floor(Math.random(randomColors.length) * randomColors.length)];
alert(randomColors + "\nPicked Color is Red " + pickone.rgb.red + " Green " + pickone.rgb.green + " Blue " + pickone.rgb.blue );