Assigning color to geometry on python

i have few curves,breps in my rhino port.Using python id like to assign different colour to all curves and all breps like how custom preview component works. i tried all ways but nothing seems to work. hope anyone could solve this for me. ive attached my file here
color.3dm (49.1 KB)

If you’re trying to draw stuff with Python scripting components in Grasshopper, you can do something like this:

See more here: