The vivid yellow color normally associated with supermarket bananas is in fact a side effect of the artificial ripening process. Tree ripened bananas have a greenish yellow appearance which changes to a brownish-yellow as they ripen further.
They become bright yellow when ripe to attract animals to eat them and spread the seeds around in their droppings. Why yellow instead of bright red? It's what nature came up with, and she doesn't answer questions.