perhaps something along the lines of:
Code:
// store the colors
/*
say red=1
blue = 2, etc
*/
NSArray *colors = [NSArray arrayWithObjects: @"red",@"blue",@"green",@"orange",@"purple",@"white",nil];
your loop
NSString *name = [colors objectAtIndex: value from brickLayout ];
// create the name based on the index and the colors array
NSString *imgName = [NSString stringWithFormat: @"%@%d.png",name,your_array_index];
// assign your image
UIImage *img = [UIImage imageNamed:imgName];
end loop
Mike