There’s no way to know without actually witnessing it, but it could very easily be that you looked unusual to him in some way. Mine used to bark at us (who they live with!) if we wore a hat or something else they weren’t used to.
There is an black Obedience judge (from Canada) who routinely offers when he judges to let people bring their dogs up and see him beforehand in case their dogs haven’t had much experience being around people of other skin colors, so I guess it can be an issue for some dogs. My dog could care less about the color of his skin, but was a bit intimidated by him being probably at least 6’4 and skinny (I am 5’ and chubby, LOL).