How to make an interactive map like in HOI4 or AOH2/3

I want to do with an interactive map. I have already made mechanics so that a map of provinces is generated, and so that each of them is given a color in hex and ID format. But I don’t know how to make the map itself with transparent provinces (maybe so that their borders are visible), and at the same time, so that each province is clickable. And when you click on it, you are told its ID. It’s all I need. I tried to do it by searching for the pixel color at the location of the mouse click, but it didn’t work. Help me please.

It would help if you showed some screenshots/videos of what you’re trying to achieve. Can you also give the complete names of the games you are using as references? I’m guessing the first one is Heart of Iron but I could be wrong and I have no idea what the other one is.

Hearts of Iron 4, Age of History 2.