String[] allColors = context.getResources().getStringArray(R.array.colors);
Color.parseColor(allColors[0]) // red
Color.parseColor(allColors[1]) // green
Color.parseColor(allColors[2]) // blue
TypedArray ta = context.getResources().obtainTypedArray(R.array.colors);
int[] colors = new int[ta.length()];
for (int i = 0; i < ta.length(); i++) {
colors[i] = ta.getColor(i, 0);
}
ta.recycle();
int[] rainbow = context.getResources().getIntArray(R.array.rainbow);
for (int i = 0; i < tileColumns; i++) {
paint.setColor(rainbow[i]);
// Do something with the paint.
}