def convert_to_hex(rgba_color):
    """ Converts rgba colors to hexcodes. Adapted from
            https://stackoverflow.com/questions/35516318/plot-colored-polygons-with-geodataframe-in-folium
    """
    red = str(hex(int(rgba_color[0]*255)))[2:].capitalize()
    green = str(hex(int(rgba_color[1]*255)))[2:].capitalize()
    blue = str(hex(int(rgba_color[2]*255)))[2:].capitalize()

    if blue=='0':
        blue = '00'
    if red=='0':
        red = '00'
    if green=='0':
        green='00'

    return '#'+ red + green + blue