  N-body + hydrodynamical simulations of the formation and evolution of galaxy
groups and clusters in a LambdaCDM cosmology are used in order to follow the
building-up of the colour-magnitude relation in two clusters and in 12 groups.
We have found that galaxies, starting from the more massive, move to the Red
Sequence (RS) as they get aged over times and eventually set upon a ``dead
sequence'' (DS) once they have stopped their bulk star formation activity.
Fainter galaxies keep having significant star formation out to very recent
epochs and lie broader around the RS.
  Environment plays a role as galaxies in groups and cluster outskirts hold
star formation activity longer than the central cluster regions. However
galaxies experiencing infall from the outskirts to the central parts keep star
formation on until they settle on to the DS of the core galaxies. Merging
contributes to mass assembly until z~1, after which major events only involve
the brightest cluster galaxies.
  The emerging scenario is that the evolution of the colour-magnitude
properties of galaxies within the hierarchical framework is mainly driven by
star formation activity during dark matter halos assembly. Galaxies
progressively quenching their star formation settle to a very sharp ``red and
dead'' sequence, which turns out to be universal, its slope and scatter being
almost independent of the redshift (since at least z~1.5) and environment.
  Differently from the DS, the operatively defined RS evolves more evidently
with z, the epoch when it changes its slope being closely corresponding to that
at which the passive galaxies population takes over the star forming one: this
goes from z~1 in clusters down to 0.4 in normal groups.
