How can you make fabric colorfast?

You can soak them in water with vinegar and salt then rinse. Be sure to use cold water when you soak the item, and do not wash it with light colored clothes until you know the color will not bleed onto the other items, and always wash it in cold water. Do not hang outside on a clothes line, because the sun will fade colors also.

If you are washing cotton, you can add about 1/4 cup table salt directly to your wash water to help prevent color loss. This will also help keep dark fabrics from fading into the light color fabrics during wash.

If you do have clothes that fade, especially as they are worn and washed repeatedly, you can always re-dye them. Just buy the appropriate color clothes dye, and follow the directions. If it is an item that you would like to have matching socks, tee shirts, etc. you can put those items (white) in with the dye bath, and they will be a perfect match.