The HERC2 gene plays a crucial role in determining eye color by regulating the expression of the OCA2 gene, which is directly involved in the production of melanin. Mutations in HERC2 can lead to variations in eye color, and it also has implications in the development of certain genetic disorders.