  We present a study of the evolution of brightest cluster galaxies (BCGs) in a
sample of clusters at $0.05 \leq z<0.35$ from the SDSS and WISE with halo
masses in the range $6 \times 10^{13}M_\odot$ (massive groups) -
$10^{15.5}M_\odot$ (Coma-like clusters). We analyse optical and infrared
colours and stellar masses of BCGs as a function of the mass of their host
haloes. We find that BCGs are mostly red and quiescent galaxies and that a
minority ($\sim 9$\%) of them are star-forming. We find that the optical $g-r$
colours are consistent with those of red sequence galaxies at the same
redshifts; however, we detect the presence of a tail of blue and mostly
star-forming BCGs preferentially located in low-mass clusters and groups.
Although the blue tail is dominated by star-forming galaxies, we find that
star-forming BCGs may also have red $g-r$ colours, indicating dust-enshrouded
star formation. The fraction of star-forming BCGs increases with redshift and
decreases with cluster mass and BCG stellar mass. We find that cool-core
clusters host both star-forming and quiescent BCGs; however, non cool-core
clusters are dominated by quiescent BCGs. Star formation appears thus as the
result of processes that depend on stellar mass, cluster mass and cooling state
of the intra-cluster medium. Our results suggest no significant stellar mass
growth at $z<0.35$, supporting the notion that BCGs had accreted most of their
mass by $z = 0.35$. Overall we find a low (1\%) AGN fraction detected at IR
wavelengths.
