  We extend our previous physically-based halo occupation distribution models
to include the dependence of clustering on the spectral energy distributions of
galaxies. The high resolution Millennium Simulation is used to specify the
positions and the velocities of the model galaxies. The stellar mass of a
galaxy is assumed to depend only on M_{infall}, the halo mass when the galaxy
was last the central dominant object of its halo. Star formation histories are
parametrized using two additional quantities that are measured from the
simulation for each galaxy: its formation time (t_{form}), and the time when it
first becomes a satellite (t_{infall}). Central galaxies begin forming stars at
time t_{form} with an exponential time scale tau_c. If the galaxy becomes a
satellite, its star formation declines thereafter with a new time scale tau_s.
We compute 4000 \AA break strengths for our model galaxies using stellar
population synthesis models. By fitting these models to the observed abundances
and projected correlations of galaxies as a function of break strength in the
Sloan Digital Sky Survey, we constrain tau_c and tau_s as functions of galaxy
stellar mass. We find that central galaxies with large stellar masses have
ceased forming stars. At low stellar masses, central galaxies display a wide
range of different star formation histories, with a significant fraction
experiencing recent starbursts. Satellite galaxies of all masses have declining
star formation rates, with similar e-folding times, tau_s ~ 2.5Gyr. One
consequence of this long e-folding time is that the colour-density relation is
predicted to flatten at redshifts > 1.5, because star formation in the majority
of satellites has not yet declined by a significant factor. This is consistent
with recent observational results from the DEEP and VVDS surveys.
