We say that someone is in "a brown study" when he or she is in a state of deep thought or their thoughts are far away. It's a very old expression dating back to the 16th Century, and it possibly originally meant much the same as "sunk in gloom", which may account for the word "brown".