How do I find the velocity of an object and use it to chaneg the colour of a material?
As I told in comments, you can get that with a particle emitter. On the next image, you find a cube emitting a ball. The material of the emitted ball is the node setup presented. It works in cycles. 

If you need to get a surface made of the particles, you can use Cubesurfer addon, or instead of using a sphere as emitted object, you use a metaball, and fine tune the options of it (size, etc). However, the generated surface wont be with colour change by velocity, for both methods.

If you dont want to use a shape itself, another way, in the "particles" setup, you render as "halo", on "viewport display" you sent as "point", in "colour" you can choose "velocity" or "acceleration". You can fine tune the colours increasing "fade distance", as showed in the next image: