The pigments that determine the color of the shell help maintain the temperature of embryo development in the egg.

Eggshell calcium carbonate is white. However, bird eggs show a wide variety of shades associated with the presence of two enzymes - brown-red protoporphyrin and blue-green biliverdin. Color details depend on their quantity, distribution, and so on. This relatively simple mechanism allows different birds to lay eggs in many colors, and they often take advantage of this to achieve camouflage coloration that hides the clutch from predators.
But no less often there are shades that are completely non-camouflage, the role of which is still unclear. It is hypothesized that a certain distribution of pigments can protect embryos from UV rays, help parents distinguish their clutch from neighboring ones, and the like. However, Daniel Hanley and his colleagues have shown that temperature is a key factor in shell color. They write about this in an article published in the journal Nature Ecology and Evolution.
Biologists have carried out a detailed analysis of the color of eggs in 634 bird species from all over the world. By plotting the characteristic brightness and colors on a map, the scientists found that inhabitants of colder regions generally have darker shells than birds that hatch chicks in areas where the sun shines brightly and warmly. If the coloring was connected precisely with the need for protection from UV radiation, one would expect a completely opposite picture: in the southern regions with a bright sun, it is maximum, so more pigment would be required for screening.
The authors associate the existing distribution of pigments and colors with the temperature characteristic of the place where the chicks are reared. In cold weather, darker eggs allow more radiation to be absorbed and further warm up the embryos that mature inside. Conversely, light shades in hot regions help to save future chicks from overheating.