Java source directories for Android Studio project flavors not rendered in blue

Your main directory (content root) sources will always be blue colored by default, but others depend on the activeness.

The blue color directory shows that the build variant or content root is active and if you will use the Run button of IDE, it will take these sources to compile and build you app. Only one content root can be active at a time for building the app.

You can change and make any directory/flavor active for your content root to compile and build your app when run option is used. It can be done from Build Variants tab available in left panel of your Android Studio.

Like shown in picture below :

Production is active here:

prodmark

uat is active here:

uatmark


Based on user pyus13 's answer I found that by going to build variants and simply selecting flavor2release in your case, the folder becomes blue.

So by clicking the release version of the flavor you want to make active the folder becomes blue.

Hope this helps. Thanks pyus13!