So if you want to make a background and text color retrieval routine to help a graphic library adapt to the user's theme: you're screwed.
And if you're not aware about the problem, there are plenty of developers who ask this on StackOverflow, reddit... The general answer is "we changed this because we do better things now". Better ? That was a pain to find colors, now it's impossible!
And yes. #Gnome can use others colors than GTK theme. But in facts, themes provides the adapted colors for GTK. So, I will use gtk3 context for a while, then my code will be broken...