The domain of the function is limited to fruit names where the rule applies. The function does not work for non-fruit names or for fruit names that do not have a commonly associated color.