Consider the relationship between genes and alleles: While a gene is the overall unit that codes for a trait, alleles are the different versions of that gene that can exist. For example, the gene for eye color may have alleles for blue, brown, or green eyes.