"Being in a brown study"

Being in a brown study is a term used to describe someone who is daydreaming. Can anyone help by telling me its derivation ?

Being in a brown study means deep in thought, and more often than not, deep in unhappy or depressing thoughts. According to the American Heritage Dictionary, it comes from brown as in a figurative sense of gloomy, and study, which among many other things can mean "a state of mind or mental absorbtion".

"Lack of company will soon lead a man into a brown study." Whether or not it's true, that [_Dice-Play_,] 1532 admonition is the first known example that shows the "reverie" sense of "study" combined with "brown" (in the old and now rare sense, "gloomy"). Today, not all brown studies are "gloomy" -- some are merely abstracted -- but not, we hope, to the extent that provoked the editors of an encyclopedia of the 1950s to call it "a state nearly related to hypnosis and characterized by the ... arrest of bodily movement."
From Merriam-Webster's Word of the Day (March 12, 2000)
----------
Tyler has also tendered us two near masterpieces, The Accidental Tourist and Saint Maybe , the first tragicomic leaning toward tragic, the second a brown study of duty, redemption, and, to quote Emily Dickinson, "that pale sustenance, Despair!"
--Katharine Whittemore, "Ordinary People," _The Atlantic Monthly_, May 2001.