There is no way to precisely determine the color of a baby's eyes before it is born, but it is possible to predict the chances of a certain eye color by looking at the genetics of the parents and grandparents. Still, each parent only passes on one gene, and due to dominant and recessive traits, there are a number of different possible outcomes.
It is generally known that the gene for brown eyes is dominant, and the blue-eye gene is recessive, while green is in between the two. This means that for a child to have blue eyes, both parents have to pass on a blue-eye gene to the child. However, blue eyes can be passed on even if both parents have brown eyes, provided they both have one of each genes and pass the blue-eye gene on to the child.
This is why it helps to also know the eye color of the grandparents as well, as this can give a better idea of what genes each parent may have. If both parents have a long history of all blue or all brown eyes in their families, then eye color may become easier to predict. However, scientists now believe that eye color may be polygenic, or determined by multiple genes, according to BabyMed.