I was going to fight at a friendly gym to train it, and I noticed the text turned green. I changed which Pokémon I was going to use between a few different CP level, and they were all green, no matter if the Pokémon I had was higher or lower than the one in the gym. Does it have anything to do with the adjustment for CP level in gyms, because the CP hasn't changed ever that I noticed.
I believe the CP changes to green only for training. It likely changes to let you know its a training fight and to help indicate that it is a friendly gym.
If you watch this video around the 1 minute mark, you can see that for the Dragonite, it turns green and a boxing glove appears next to the CP. The CP is also reduced. But, for the rest of the Pokémon in the gym, it still turns green with a boxing glove, but none of the CPs reduce for those pokémon (this rules out the question of if it has to do with the scaling or not). You can also see that in the bottom right, the button to initiate the fight is a boxing glove.
If you take a look at this video at the very beginning, you can see that the symbol to initiate a fight looks like two Poké balls clashing together, and the CP never changes color (and the boxing glove next to the CP doesn't appear).
Since I cannot find any direct sources discussing this manner, I would have to argue the points I made above are correct. In my opinion, the change is too subtle to be noticed by most, leading me to believe that is the reason why it is proving difficult to find any other sources discussing this.