Birds which build in trees generally have blue or greenish eggs, either spotted or unspotted, while birds that build in bushes or near or on the ground are likely to lay speckled eggs. The color of individual eggs is also genetically influenced, and appears to be inherited through the mother only, suggesting the gene responsible for pigmentation is on the female-specific W chromosome (female birds are WZ, males are ZZ). Color was once thought to be applied to the shell immediately before laying, but this research shows coloration is an integral part of the development of the shell, with the same protein responsible for depositing calcium carbonate, or protoporphyrins when there is a lack of that mineral.