I'll give you a well documented historical example:
https://en.wikipedia.org/wiki/Passing_(racial_identity)
If you need more contemporary examples, ask.
Forgive me, perhaps I'm not completely up to speed; but did either of these shooters target people based solely on their ethnicity?Did they shoot only blacks or browns or a combination of the two? The little I have looked at seems to indicate they just wanted to kill random strangers and chose a convenient soft target. If that synopsis is correct, the only way you could protect yourself from being targeted would be to never go shopping or to any other place where the public gathers