Random, yes. Haha, Its the green stuff.
*Fun fact* color is only seen because the material which "gives off" that color reflects that shade of light in the spectrum.
Plants are green because they absorb all other colors of light and reflect green.
So if you put them into total darkness (i.e. a cave) wouldn't they be black? white? Clear!? It will forever be a mystery.