Many of the dyes used today come from chemicals that are taken from petroleum or from coal. These chemicals can be used to synthesize more natural plant-based dyes that were once used. For instance, to dye a pair of jeans used to be done with the indigo plant which could be used to create indigo fabric dye. Today, synthetic indigo dye is made with a combination of caustic soda, sodium phenylglycinate and sodamide to form a chemical called indoxyl. The sodium phenylglycinate in the mixture is made from a chemical made in another chemical process by adding ammonia to a chemical called chlorobenzene. This process begins with another chemical that can come from either petroleum or coal. Because petroleum and coal are both inexpensive, many fabric dyes are currently made in a similar fashion.
There are a number of different classifications for these synthetic dyes. One type is called aniline dye, though these dyes are not made from aniline anymore. Like the synthetic indigo dye, they come from either petroleum or coal. Cotton clothing is most often dyed with either reactive dyes, direct dyes or sulfur dyes. Clothing made from nylon usually colored with acid dyes. Clothing made from modacrylic or acrylic are generally colored with basic dyes. Clothing made from polyester or acetate are usually colored with disperse dyes.
Natural dyes are becoming popular again because of their lesser impact on the environment. These dyes are often plant-based or made from insects. A natural crimson dye is made from cochineal insects and makes up the carmine natural dye that is called natural red 4 in the dye industry. The logwood tree is the source of the black hematein dye that makes up natural black 1. Lac is a substance created by a number of different insects, and it can be used to make a red dye that is known as natural red 25.
In addition to these natural chemicals, using a natural dye to color a fabric usually requires that metallic salts are used along with the dye to make the fabric keep the color longer and to keep it from fading with washing and with exposure to sunlight. Synthetic dyes generally last longer and don’t fade as quickly as natural dyes, which makes the salt important for maintaining the quality of the natural dye. Natural dyes, like synthetic dyes, must be proven safe for humans before they can be used on commercial fabrics."
http://www.fibers.com/blog/what-are-clothing-fabric-dyes-made-of/