Tutorial time.
I was asked about how you deal with text on icons that vary greatly in darkness/light. Here is one solution.
We take as our example this random icon of Ms Marilyn Monroe.
Icon was created specifically for this tutorial, by the way, and I'm not going to spend time on explaining how you go from ordinary photo to this base. Other tutorials will tell you that.
You can see that Marilyn has a light coloured shirt on but the surrounding elements are quite dark. How can you apply text to this?
First, create a usual text layer and write whhat you want with the dark colour of your choice. The following should look quite familiar:
Once you have moved your text to where you want it to be - copy that text layer. You do that by right-clicking on the layer and choosing "Duplicate layer". Once you've done that, change the colour of your text to the light colour of your choice.
You can see there's a tiny outline of the dark colour beneath the light colour, but fear not - we are going to change things. Right click on your upper type layer and you'll see a menu. Choose "rasterize layer". Do the same thing for the dark text layer.
Once both text layers have been rasterized, you can meddle with them.
At this point you'll want to erase the light text layer from the light areas of your image and vice versa for the dark areas. To do that, you choose your eraser (small size, 3px or so - this enables you to control what is erased) and start erasing. Be careful that you have chosen the light text layer when you want to erase the light text etc.
Final result (with added tiny text for decorative purposes):