Random color script

 From:  Frenchy Pilou (PILOU)
3876.1 
Does it possible to have a script that attribute a random color to a general selection
with different colors to types?
(Curve,surface,edge,faces) not solid because it's yet attributed by the previous type ;)

Or maybe this previous exists, i don't remember ?
Attachments: