Chances are, even before being born, your eyes were once blue. The color of the eyes change shortly after being born, this is due to melanin deposited in your irises being exposed to ultraviolet light. For babies of brown or black-eyed descent, the blue is a little less pronounced, more like a cloudy blue.
The more melanin you have in your irises, the darker the color it gets. The fewer, it may end up from gray to blue. And no, you can’t do anything to keep your baby’s eye color stay blue. Eye color stabilizes by the 6th month after birth, with continuous production of melanin of up to a year.
Part of eye color is genetic. If you have parents whose eyes are blue or green or other, chances are you’ve inherited them. But this is not always true.