Merge pull request #2050 from pelson/colormap_api

Added the from_levels_and_colors function.
Fix PEP8 whitespace issue