Why does an egg change color and texture when heated?
Egg proteins undergo significant physical changes on heating, thus affecting colour and texture of the egg.
Protein molecules in an egg are globular; the long chains of amino acids are curled and folded on themselves so that they look spherical. In this form, they are free floating in the surrounding water.
Heat causes them to uncurl and form fresh bonds with other protein molecules so that instead of free floating molecules in a liquid, you have a web of interlinked protein molecules that trap the water molecules. This is termed coagulation.
As more heat is applied, this makes the egg progressively harder and more rubbery.