---
abstract: 'The observed abundance of very red galaxies at high redshift has been recognized as a long standing problem for hierarchical models of galaxy formation. Here we investigate the effect of AGN feedback associated to the bright QSO phase onto the color distribution of galaxies from $z=0$ up to $z\approx 3$, and on the abundance of extremely red objects (EROs, with $R-K>5$) and distant red galaxies (DRGs, with $J-K>2.3$) up to $z\approx 4$; to this aim, we insert a blast-wave model of AGN feedback in our semi-analytic model of galaxy formation, which includes the growth of supermassive black holes and the AGN activity triggered by mergers and interactions of the host galaxies. In such a model, the AGN feedback is directly related to the impulsive, luminous quasar phase. We test our model by checking the consistency of its results against i) the QSO luminosity functions from $z=0$ to $z=4$; ii) the observed local relation between the black hole mass $m_{BH}$ and the mass (or velocity dispersion) of the host galaxy; iii) the color-dependent galaxy luminosity functions up to $z=3$. We then show how the efficiency of the AGN feedback associated to QSO phase increases with $z$. At low redshift 