The hadith recommends white clothing for shrouding: وَكَفِّنُوا فِيهَا مَوْتَاكُمْ
Translation: And shroud your deceased in them (white garments).
White is preferred, but validity does not depend exclusively on the color white. Appropriate clean cloth fulfills the fundamental purpose of covering.