I've looked everywhere for this answer and can't figure out a way to call the automatically generated color pallet in addGlPolygons fillcolor. I know I can define my own color pallet but what if I want to use the automatically generated color pallet with a legend?
library(mapview)
library(leaflet)
library(leafgl)
library(sf)
fran = st_cast(franconia, "POLYGON")
#> Warning in st_cast.sf(franconia, "POLYGON"): repeating attributes for all
#> sub-geometries for which they may not be constant
leaflet() %>%
addProviderTiles(provider = providers$CartoDB.DarkMatter) %>%
addGlPolygons(data = fran, fillColor ="SHAPE_AREA", popup = "NAME_ASCI") %>%
setView(lng = 10.5, lat = 49.5, zoom = 8)%>%
addLegend(colors="SHAPE_AREA", labels="SHAPE_AREA") #this is the issue