When the G gene is present, the fruit flies have red eyes. When the G gene is absent, the fruit flies have white eyes. This is because the G gene codes for an enzyme that is necessary for the production of red pigment in the eyes. Without the G gene, the fruit flies cannot produce red pigment and their eyes appear white.