Is there a way to do this with material nodes only?
I can find a particle info node:
https://docs.blender.org/manual/en/latest/render/shader_nodes/input/particle_info.html
But the object info node doesn't have an input... the texture coordinate node does have an input for a different object, but then I can't find the distance node:
https://docs.blender.org/manual/en/latest/editors/texture_node/types/converter/distance.html