Skip to content

Add hexadecimal color code option for marker icon background #1466

Open
@lhoupert

Description

@lhoupert

Is your feature request related to a problem? Please describe.

When adding a marker on a folium map such as:

fm = folium.Map(location=(44,3), tiles="Stamen Terrain")
folium.Marker(
        location=(44,3.2),
        popup="data1",
        icon=folium.Icon(color='#8000ff',icon_color='#4df3ce', icon="star", prefix="fa"),
    ).add_to(fm)
fm

It seems that the background icon color cannot be an hexadecimal color:

color argument of Icon should be one of: {'lightgray', 'pink', 'darkred', 'red', 'lightblue', 'darkblue', 'darkpurple', 'green', 'blue', 'lightgreen', 'lightred', 'gray', 'cadetblue', 'orange', 'purple', 'darkgreen', 'black', 'beige', 'white'}.

Is there an easy way to implement that functionality?

I am happy to work on a PR if someone can tell me where to start :-)

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementFeature request or idea about how to make folium betterhelp wantedHelp is welcome for this issue or PR

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions