  We present a comparative analysis of the properties of passive, star-forming
and transition (green valley) galaxies, in four discrete environments: field,
groups, the outskirts and the core of X-ray clusters. We construct samples of
galaxies from the SDSS in these environments so that they are bound to have
similar redshift distributions. The classification of galaxies into the three
sequences is based on the UV-optical colour $NUV-r$. We study a number of
galaxy properties: stellar mass, morphology, specific star formation rate and
the history of star formation. The analysis of green valley galaxies reveals
that the physical mechanisms responsible for external quenching become more
efficient moving from the field to denser environments. We confirm previous
findings that green valley galaxies have intermediate morphologies, moreover,
we find that this appears to be independent of the environment. Regarding the
stellar mass of green valley galaxies, we find that they tend to be more
massive in the field than in denser environments. On average, green valley
galaxies account for $\sim 20\%$ of all galaxies in groups and X-ray clusters.
We find evidence that the field environment is inefficient in transforming low
mass galaxies. Green valley galaxies have average star formation histories
intermediate between passive and star forming galaxies, and have a clear and
consistent dependence on the environment: both, the quenching time, and the
amplitude of the star formation rate, decrease towards higher density
environments.
