To create objects of different colors dynamically, you can use the technique described in the following video:
How-To video: Creating cars of different colors