2020 change particle system color script code example
Example 1: particle system start color
Color myColor;
var particlesMain = gameObject.GetComponent<ParticleSystem>().main;
particlesMain.startColor = myColor;
Example 2: unity particle system color
Color myColor;
gameObject.GetComponent<ParticleSystem>().startColor = myColor;