Fix bug for colormaps with only 1 colour

The code for generating a custom colormap fails to generate valid TIKZ code for a MATLAB colormap with only 1 colour, as a colormap with 1 colour is not valid in TIKZ. This checks for that case and simply repeats the colour to get the desired effect.

(Sorry for the messy commit history, the merge overwrote my changes and I didn't notice right away)