Melanin gives a foraging advantage and is heritable through a dominant gene. It has nothing to do with demons.
It was narrated that Abu Dharr said:
The messenger of Allah said: “When anyone of you stands to pray, then he is screened if he has in front of him something as high as the back of a camel saddle. If he does not have something as high as the back of a camel saddle in front of him, then his prayer is nullified by a woman, a donkey or a black dog.” I (one of the narrators)said: “What is the difference between a black dog, a yellow one and a red one?” He said: I asked the Messenger of Allah just like you and he said:”The black dog is a shaitan.”
Grade: Sahih (Darussalam)
Sunan an-Nasa’i 750
Vol. 1, Book 9, Hadith 751