Changed the colormap to be a function.

Code for velocity calculation.