Colormap is a way to convert some value with given range to RGB color.
There are multiple colormaps available in matplotlib package.
If you don't want to bring matplotlib's numerous dependencies with you, here is a simple solution, based on matplotlib data: