I would offer the customer a refund or an exchange for a new batch of yarn, although i would explain to them that if they wish to exchange then it may take a little extra time for the following reasons. I would also apologise to the customer that it has happened and for the inconvenience. I would also ask the customer as politely as possible, if they could explain the washing method they used naming in detergents they used, incase they have done or used somthing unusual (for example they may have inadvertantly used a particualrly strong soap).
i assume you used a method of dying you have used before. Do you have any of that batch left or could you do another batch in the same way, using the same dyes etc? then do a test wash to see if you can figure out what the problem was. Explain to the customer that you are doing this to make sure that any future purchases from you or the exchange piece will not have the same problem. If you can not find any problem with the batch and the customer wishes to exchange then go ahead but make sure the care instructions are clear and offer to pay for any postage incurred.
If the customer does not go ahead then again apologise and give full refund including postage and perhaps an extra incentive to (another $10 on top or a small gift perhaps).
This would be the case no matter how well you know the person who has baught the yarn, just how formal you are may vary. Throughout, being polite, honest and communicative is the key.
I am Tarriknits on Ravelry
This is my not necassarily knitting related blog