ok get this, if you want to change the color of a Unity particle system, you get a reference to ParticleSystem.main, then set the startColor of that to whatever you want. then you do nothing else.
ParticleSystem.main is a struct.
ParticleSystem.main is also read only.
let me reiterate. you ASSIGN A VALUE TO A PROPERTY OF A READ-ONLY STRUCT TO CHANGE AN ACTIVE PARTICLE SYSTEM.
@kaliranya internally the ParticleSystem.MainModule struct probably only has, like... one member? Probably a reference to the original particle system instance. Then everything else are just {get; set;} properties that, when accessed, read and write to some other internal object used to actually send the data to the GPU and generate the particles.
Basically it's a smoke-and-mirrors way of what really should have been something like ParticleSystem.SetStartColor(Color color)...