Sunlight does not directly affect a newborn's eye color.
Eye color is determined by the amount of melanin, a pigment, present in the iris. This is genetically inherited from both parents.
While sunlight can cause the iris to dilate or constrict, it does not change the underlying pigment that determines eye color.
A newborn's eye color may appear to change over the first few months of life, but this is because the melanin in the iris is still developing.
The final eye color is usually established by around 6-12 months of age.