Wouldn't Africa have been closer and less difficult to colonize?
Africa is certainly closer, but it was much more difficult to colonize. Here's a few reasons why:
In Africa, Europeans would often die from malaria and sleeping sickness. It was known as the "White Man's Graveyard." Only the discovery of quinine in the late 1800s allowed Europeans to successfully send large invasion forces into Africa without them all dying of malaria. Europeans couldn't conquer much in Africa (although Portugal had conquered a few port cities centuries earlier) until the late 1800s. Malaria still devastates Africans to this day, but large swathes of the population have genetic mutations that give them limited or total immunity to malaria.
In contrast, Africa had had metal weapons for as long as Europeans had had them. They had horses, camels, and oxen for riding and for moving goods around, and they got guns around the same time as Europeans did. Europeans had no military advantage over Africa for most of the early imperial period (1500-1900). Hence, they rarely tried, and when they tried they rarely won. It was the invention of the Gatling gun, a product of European coal-powered mass industrialization, that gave European colonial powers the key military advantage over African powers. This new military advantage, along with quinine, inaugurated a "Scramble for Africa" in the 1880s, as European colonial powers rushed to stake claims to vast swathes of African territory and carve up the map. With the introduction of the Gatling gun, their invasion forces (now mostly safe from malaria, remember) were unbeatable by lesser-equipped African armies. The Europeans had always had a military advantage over the Americas, but it was only in the late 19th century that they got one over Africa.
Africa, in contrast, was not so "profitable." Africa was not capable of being "emptied" by disease and genocide. It was full of people, and people who could not be easily killed and their land taken from them. There were some small areas of European settlement, Dutch and British settlers had started coming to Southern Africa starting in the late 1600s. But for the most part, there was no land for the taking in Africa. And land was the primary enticement of colonization during the early imperial period. It's not that Africa was poor, it had a wealthy international trade in gold, ivory, slaves, salt, and spices. But these benefits could be easily acquired by trading and only very expensively acquired by conquest. So most Europeans chose trade.
That was, of course, until the late 1800s. Industrialization had created new markets for new goods, especially things like natural rubber, from the rainforests of Central Africa. And rather than trade for them, the Europeans with their newfound military advantages, found it easier and cheaper to colonize instead and take these goods by force. Congo was a good example. The Belgian king Leopold took over Congo as his personal property and more or less enslaved the entire population, who were forced to tap rubber under penalty of mutilation (having hands or feet cut off) if they failed to produce enough. Millions, possibly ten million in all, were killed as a result of colonial violence here. Colonial violence that had only been possible because of the overwhelming military advantage that the Gatling gun produced, and the violence wouldn't have been profitable if not for the industrial revolution creating a new market for rubber. Before the late 1800s, this colonization couldn't have been possible because the natives would have successfully repelled such invasion and subjugation, and the invasion wouldn't have been attempted in the first place because there was nothing to be easily harvested, like rubber. Land was always easy taking for the Europeans in the Americas, but not so in Africa.