What you're referring to is more of a cultural phenomenon than any kind of racial discrimination in the classic sense of the word
In the old days, the concepts of 'racism' and 'discrimination' generally applied to blacks, certainly in the US (though of course, native Americans have also been treated pretty appallingly throughout history). Europe historically saw very different racism. Jews in particular were persecuted and discriminated against in many parts of Europe going back centuries. The Nazis then included groups like gypsies and gays to the list of those persecuted.
But it wasn't till after WW2 that Europe saw any significant numbers of blacks, many of whom emigrated to their respective 'mother countries' after the collapse of overseas empire and the independence of former colonies. People looked askance at blacks because they were new and different, but there was never anything like the institutional discrimination of the southern US.
During the last half of the 20th century, these black and brown people from ex-colonies were increasingly assimilated - they spoke the language, they inter married with local women, and in time became totally accepted.
At the same time, Muslim emigration to western Europe started expanding quite dramatically, with large numbers of mainly Turks and Moroccans settling in Germany, Holland and Belgium. In time, certain sectors of the indigenous population started resenting these particular newcomers because most did not speak the local language, and many wouldn't even try to learn it. There has been relatively very little inter marriage between Muslim immigrants and locals, certainly by comparison with the previous wave of immigrants. There has also been 'ghetto-forming', i.e. these immigrants stayed largely in their own areas and showed far less desire to integrate and assimilate than the previous wave of mainly black and brown immigrants post WW2.
So, the issues western Europe has now have nothing to do with color, and also not so much with religion itself, but with the fact that many Turks and Moroccans choose not to integrate, and that pisses off some locals. That's what I mean by this isn't racial discrimination in the classic sense. Also, I have deliberately painted with a wide brush and kept to generalizations. Of course, the issues are far more complex than I have briefly indicated.
It is also true that the locals (some of whom may even be black and brown!) who really have issues with Muslim immigrants represent a very small proportion of the population as a whole.