unity particle system color

C#
Color myColor;
gameObject.GetComponent<ParticleSystem>().startColor = myColor;
Source

Also in C#: