One object with multiple elements ,different colours to elements inside object After applying a particle instance I now have 1 object that has hundred of elements inside 
I would now like to assign random colours to the different elements 
I know how to do it to differnet objects and particle systems but not with one objects that has multiple elements inside 
The object info node , random output is only relevent when the object is duplicated , but the elemnts inside still have the same colour 



The screenshot shows a sphere with hair particles ( left  )  , for the rendered view I choose path
Then I created a small cube ,  and added a particle instance  modifier , pointed that to the sphere particle system   and applied the modifier 
The result is a sphere (object ) made out of cubes ., right part of the screen.
ONe object with multiple mesh islands 

I know how to add differenet materials  to differet faces , and I could do that here too , but we have around thousand cubes here , so doing it manually requires a lot of work 
I basically want 1 material , and apply random colours to the separate mesh islands .
SO far , I have.t found the correct   node module yet .

On the other hand , If I would do it the other way , choose the cube as a rendered object for the particle system , then the particle node , random output  would do wha I want .
But this is not relevant here , since I'm working with an instanced particle object that is applied 
I tried different textures , texture input node set to generated and going into a colour ramp ..all with mixed result , because something one cube has 2 different colours .
So bassically a need a module that goes into a colour ramp , and apply  1 colour to each cube , in a random order 
The particle node random output only works for particle systems and sadly not in my case ( 1 object , multiple mesh islands ) 

Then we have the object info node , this will work on different objects only , but sadly not mesh islands
Assuming Blender Render.

In [Edit] mode  you can place the mouse over a connected vertex group and 

press l the second letter of  B(l)ender to increase your selection .

Then in the materials panel pick one material and click
[assign] button.



Particles can be created with different colors in groups or duplicated faces or material nodes so it may be easier to let the creation of particles assign colors for you.