Change the editor background color depending on directory of my File

In my workflow, I have two directories of files that I regularly access in the same project: the first is my normal code, and the second is the compiled version of that code. I often make changes in the first directory, run a program to compile it, and then check the file in the second directory to make sure there aren’t any issues.

However, it’s not always easily distinguishable which directory I’m in, since the filenames and most of the actual code are going to be the same. Is there a way to switch the background of the editor itself when I’m inside files that are in a certain directory? If that’s not doable, is it possible to change the background color of the tree view for specific directories, or of the tab at the top of the page?