One way to prevent this type of color loss is to wash clothes in colder water, but all detergents work poorly in cold water, and many bleaching agents are completely ineffective in cold temperatures.
Cold temperatures hinder the effectiveness of many bleaching agents.