Even when you get into things like slavery, Africans were not enslaved because they were black. Slavery was global and of course always began as in group - whites enslaving whites, browns enslaving browns, blacks enslaving blacks, etc. The big reason that "white" on "white" slavery ended was because of a shared religion and Christian church declaring it illegal for any Christian to enslave another Christian (in times before the schisms, such as 'Christian' was reasonably encompassing). The "problem" this posed for those seeking slaves is that tremendous empires were starting to form around the world.
For instance in the ~18th century you're looking at the Qing dynasty in China, the Mughal Empire in South Asia, the Ottoman empire in the Mideast, etc.. The world was rapidly unifying under incredibly powerful empires who were more than capable of protecting their borders and people. But Africa was a major exception. It not only lacked both meaningful unification and technology, but also had a thriving domestic slave trade. This made them a prime target. It had nothing to do with the color of their skin. Had Africans happened to have had a bit less melanin, but the situation remained otherwise identical, it's extremely improbable that things would have changed in any way whatsoever.