in XP and Later when Drop shadows are off, text labels work more or less how they did in previous Windows releases. The desktop Icon text would be white or black, selected based on the chosen desktop colour in the appearance control panel.
That algorithm is still there- you are seeing it in action. If I set Windows 98SE to uise the background colours you've selected there, I get the same label text colour.
However, one thing that has definitely changes is that for some reason they';ve gone with a "designer" approach. The "designer" approach to things seems to be to not provide options, but rather dictate them. This makes sense for some things- for example, on the older Macintosh OS, you could select from a few theme colours- but you couldn't customize the colour specifically, this made sense in that context because each one was a full set of visual widgets that had been designed with that colour in mind. Makes no sense here with Windows 10, especially when everything else in the OS is effectively intended to allow for those customized colours. In the normal personalization app you get, what, 24 possible solid colour backgrounds? Bah.
Thankfully that limitation is one only present in the "Modern" Settings App. The older control panel for desktop backgrounds, From Windows 7, is still accessible:
control /name Microsoft.Personalization /page pageWallpaper
You can then customize the desktop background to any colour you want, giving you wider options that will end up with black text. I suspect it "grayscales" the colour and uses the farthest from that calculation as the icon text colour.