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;