Users expect to be able to pass a branca ColorMap to write_png and image_to_url. Make this possible by testing for the correct type and using the rgba_floats_tuple methods if it's a branca ColorMap. Add tests.
Also include changes from folium to the same function so we can remove the duplicate code from folium.
Fixes https://github.com/python-visualization/folium/issues/1571 and https://github.com/python-visualization/folium/issues/1280, when we also merge https://github.com/python-visualization/folium/pull/1708.
Users expect to be able to pass a branca
ColorMap
towrite_png
andimage_to_url
. Make this possible by testing for the correct type and using thergba_floats_tuple
methods if it's a brancaColorMap
. Add tests.Also include changes from folium to the same function so we can remove the duplicate code from folium.