“Early in its history, blue acquired symbolic meanings which are diametrically opposed. As the color of the clear sky and of the sea (both good), it came to be the symbol of purity, of fidelity, of staunchness, and of faith, and, by symbolic extension, it was chosen as one of the colors of the Virgin. Perhaps simultaneously (since both extremes involve morality and seem to be connected with the Christian religion), a flame which burned blue came to be associated with the flames of burning brimstone and therefore of hell; such a flame, quite logically, was regarded by the superstitious as an omen of death or other evil or was believed to indicate the presence of ghosts or evil spirits or of the devil himself. From these beliefs, it seems probable, developed blue-blazes, meaning hell, and such statements as “he talked blue” and “he made the air blue,” meaning, respectively, “He talked obscenely” and “He cursed and swore”: cursing or sinful talk would evoke evil spirits or the devil, whose sulphurous presence would cause flames to burn blue. Such talk, again logically, although this is admittedly conjecture, would become blue talk, and an oath or a curse a blue word.”
—Joseph P. Roppolo in American Speech, Vol. XXVII, No. 1, as quoted in Heavens to Betsy! and Other Curious Sayings by Charles Earle Funk, 1955.