Trying to change the color of the particles based on their age in 3.6.2, but I can't seem to get it to work. Even trying simpler materials doesn't seem to affect the color. I've tried using objects as the particle instance instead of halos, but the particle data doesn't seem to have access leading to the particles just remaining whatever color.
I haven't seen Halo particles used since v2.79. Back then we had a Halo-type material coming with Blender Internal render engine:
And as you can see, you could control way more things than the color.
But back then it wasn't compatible with Cycles, and Blender Internal render engine with its materials was removed since v2.80. I don't think you can do anything with the halos anymore, it's good for previewing but no shading possible.
What you could do instead is replace them by a mesh object, put the material on it, and use it in your particles' system.
As an object, you could use a UV sphere or an icosphere. But if you really want something close to halos, that are 2D shapes facing the camera (or you like performances like me):
Use a circle mesh, add a Track To constrain to make it face your render camera:
To make the shader work, you need to normalize the output of the Age between zero and one. This is because the Color ramp only takes values from 0 to 1 while the Age output gives the particle's age in frame number. To do this, use a Map Range node, and set the "From Max" value to your particles system's Lifetime:
You can even RMB the Lifetime value, click
Copy As New Driver, then RMB the From Max and
Paste Driver. This way the shader always uses the particles system's lifetime.
To get the blured sphere aspect of Halos, you need to create a procedural sphere texture, which you can do using the Object's texture coordinates and a few math nodes. Then, invert it, use a Color Ramp or a RGB Curves to controll the fallof of the "blur", and use that as a factor to mix your color data with a Transparent BSDF:
Note that, with this shader, you don' t even need to use a Circle object, a plane does the trick and it's only 2 triangles to load in memory.
In fact, all the screenshots were made using a plane mesh named as Circle. I lied. Oops.