Yeah - a good many of the former European colonies in Africa do have criminal laws against homosexuality that were introduced during European colonisation - this is very true.
Uganda's easily one of the more extreme in that regard, with quite the history of British origin anti-gay laws and more recent substantial support from US homophobic Christian lobbies.
https://en.wikipedia.org/wiki/LGBTQ_rights_in_Uganda
It's a time capsule of European origin values. Other countries in Africa are less extreme.
Worth noting that one can go to Europe and see how they treat gays, eg:
* https://en.wikipedia.org/wiki/LGBTQ_rights_in_Azerbaijan