  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=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 interactions of the host galaxies. 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 of the host galaxy. At low redshift the inclusion of AGN
feedback enhances the number of red bright galaxies, so that the color
distribution of M_r<-22 objects is entirely dominated by red (u-r>1.5)
galaxies; at 0.5< z< 2 it yields rest-frame U-V color distribution in agreement
with existing observations. In the range z=1.5-2.5, we find that 31% of
galaxies contribute to the EROs population with m_K<20 (Vega system); at such a
magnitude, the model yields an EROs surface density of 6.3 10^3 /deg^2 matching
existing data; about 80 % of the above density is contributed by passive
galaxies with old stellar populations. Extending our analysis to z=4, the model
matches the observed surface density 1.5 10^3 /deg^2 of DRGs at m_K=20; such a
population is predicted to be dominated by galaxies with old stellar
populations for z>2.5.
