Change props of subcomp based on parent comp
The layers in a pre-comp don't have access to information about the comp(s) they're nested in AFAIK, but I can think of a workaround in this case: apply a fill effect to the nested layer and drive its colour value using the name of the parent comp, e.g. 

if (thisComp.name == "Blue"){[0,0,255]}
else if (thisComp.name == "Red"){[255,0,0]}…


and so on. Or you could name the comps by their colour values— something like 255-123-001—and use js string methods to extract the colours from the comp name.