Was I wrong to brush him off?

So I was walking on my university campus this afternoon. I walked by a group of guys and one of them whistled and said ‘hey baby we should get coffee’. I had no idea who this person was and I just felt uncomfortable. I just kept don’t walking and ignored him (he then shouted ‘aww baby don’t be like that’ after me).

I don’t care if a guy tries to talk to me or asks me for coffee, but I’m not a fan when it’s done the way this guy did. Like maybe try to have a conversation with me and ask my name?

Well my friend witness the whole encounter and she ended up talking to me about it later. She said I was really rude to this guy and that I looked really racist for ignoring him (the guy was black and I’m white). She’s pretty upset with me and I don’t really understand why. I grew up in a very tiny farming town where everyone was white and came from a long lines of Canadians. So I’m just experiencing new cultures and races for pretty much the first time in my life. I don’t want to be racist in any way. My friend happens to be black so is their some kind of cultural difference here in the way people flirt? I’d have done the same thing if the guy had been white and I was raised to find the whole call-out kind of flirting rude and inappropriate. Is that different in other cultures?

I really hope I don’t offend anyone. I really am just trying to learn