Could you please tell me the literal and metaphorical meaning of "spun itself out" in the following excerpt of The Great Gatsby by F. Scott Fitzgerald, chapter 6?
"But his heart was in a constant, turbulent riot. The most grotesque and fantastic conceits haunted him in his bed at night. A universe of ineffable gaudiness spun itself out in his brain while the clock ticked on the wash-stand and the moon soaked with wet light his tangled clothes upon the floor. Each night he added to the pattern of his fancies until drowsiness closed down upon some vivid scene with an oblivious embrace."
The literal meaning of this implied metaphor is based on the comparison of Gatsby's ideas to a spider slowly spinning a glorious, fascinating web. The metaphor is used to describe the way that James Gatz, before his transformation into Jay Gatsby, used to spend his evenings and nights investing so much energy in dreaming and thinking of the glorious future that awaited him when he became rich and famous. This is the metaphorical meaning of the phrase "spin itself out," as it helps the reader imagine the way that Gatsby's dreams of what he would become gradually form and take shape before him, the way that a spider slowly and patiently but also inexorably builds a web that is fantastical in its size and proportions based on the size of the spider. In the same way, Gatsby comes to inhabit a future that is completely separate and distant from his humble past.
Note what comes straight after the quotation in this question ends:
For a while these reveries provided an outlet for his imagination; they were a satisfactory hint of the unreality of reality, a promise that the rock of the world was founded securely on a fairy's wing.
The metaphor used in this phrase therefore is all about fantasy and the alternative future that Gatsby dreams up for himself, acting as "an outlet for his imagination" and also the potential of dreams and how they can become reality. It is also important to note the way that in the quote that this question is based on there is the juxtaposition between the "ineffable gaudiness" of his dreams and the humdrum reality of his simple background, captured in the image of his "tangled clothes" and the ticking of the clock.
Literally, the excerpt is comparing Gatsby's dreams to a piece of fabric, something that is being woven out of the "grotesque and fantastic conceits" that come to him at night. Like the fibers that are spun together to make threads and then woven to make material, his tormented imagination brought together his hopes and dreams and aspirations into fabric as unkempt as "his tangled clothes upon the floor."
Metaphorically, Gatsby's ideas come together almost like the fibers coming together into yarn on the spinning wheel or like the yarn being made into cloth on the loom. Spinning like the shuttlecock of the spinning wheel, the "universe of ineffable gaudiness" winds its way into the new identity Gatsby is creating for himself. The "pattern of his fancies" shapes the colors and textures of the life history he is imagining for his life history.