An agent for coloring keratin fibers includes at least two preparations (A) and (B) packaged separately from one another, and optionally a further preparation (C) packaged separately from (A) and (B), which are mixed directly prior to application to provide an application mixture. Preparation (A) includes at least one oxidation dye precursor and at least one alkali metal salt of at least one fatty acid, and preparation (B) is flowable and includes, based on its weight, at least one oxidant and xanthan gum. The agent leads to extremely stable foams which allow the simple and intensive coloration of fibers. The stability is retained even in the presence of high concentrations of salt.