Tree frogs will darken to match the light gradient of a background... what was the light like in the room when you got home? I don't know much about specific conditions when it comes to tree frogs, but I'd start by double checking the temp and humidity of the enclosure. Hope he's ok!