Volume Shader Core to Outside different Colours

Hi,
so I need some ideas how I can achieve a pretty simple but to me not so trivial effect: heat map of a liquid or in general objects. Using the principled volume seems the right way to me, since it also has an amount of x ray in it. But how can I color the thicker parts different from the thinner parts in a shader? (Subsurface does this in a way?)

Greetings Erwin

I guess you are using some volume object ? I’m not very familiar with it but… the volume info does gives the density as output and connecting this to the colorramp may… and of course the CR output connected to the color input of the volume shader ???

Or you could do a fire sim.