color array generation ?

Hi there,

does it exist something already about color generation?
I mean, something which could fill an array (or vector) with a root + a rule to have, for instance, the 40 first green from dark to bright etc.

Let me know