  The difference in stellar metallicity between red and blue galaxies with the
same mass constrains the timescale over which red galaxies ceased to form
stars. Here we investigate this constraint with the GalICS 2.0 semi-analytic
model of galaxy formation. The advantage of this approach is that the time of
pericentric passages for satellite galaxies and the mass-loading factor for
galactic winds are not free parameters of the chemical evolution model. The
former is determined by the N-body simulation used to construct the merger
trees, the latter by the requirement that GalICS 2.0 should reproduce the
stellar mass function of galaxies. When we compare our theoretical predictions
with observations, we find that GalICS 2.0 can reproduce the observed
metallicity difference only if quenching is preceded by a burst of star
formation, which contributes to the chemical enrichment of the stellar
population. Physically, this burst can be explained as tidally-induced star
formation or as an effect of ram pressure, which not only strips gas from
galaxies but also compresses it, accelerating its conversion into stars.
