The name derives from the Latin scarlata, and that again from the Persian saqirlat. The weaving technique also had its origin in Central Asia, and made the cloth elastic by twisting the yarn. Because of this property, it was often used for stockings and tights.
Scarlet cloth was produced in red, white, blue, green, and brown colors, among others. The most common color was carmine red, though, which resulted in the double meaning of the word as a color designation.
It is probable that name of the character Will Scarlett in the Robin Hood legends referred to this type of cloth, similarly to the common occupational surnames (e.g. Weaver, Cooper, Fletcher, etc.).