How can a seed on the inside of squash germinate and be green before the squash in opened up to light? I understand the germination, but not the green.

many seeds contain green pigments that are not dependent on photosynthesis. see
http://link.springer.com/article/10.1007%2FBF02541349