I am trying to create a custom palette with 2 colors(Red and Green) and custom breakpoints for my leaflet map. Currently I am using a single reds color palette.Mymap Which I have generated using colornumeric as
pal2 <- colorNumeric(palette = "Reds", domain=NULL)
I have used it in my leaflet as
leafletProxy("map", data = selecteddata()) %>% #, data = temp2.df ------ took it out/ selecteddata()
addPolygons(data = temp2.df ,fillColor = ~pal2(selecteddata()),
highlightOptions = highlightOptions(color = "orange", weight = 2),
color = "#BDBDC3",
fillOpacity = 0.8,
weight = 1,
label = ~NAME
)
What I am looking for is to color the map in both colors green and red instead with breaks at Green - +10%, +20%, +35%, +50%, +inf Reds - -10%, -20%, -35%, -50%, -inf
How do I achieve this?
PS - Also I want to drop the uncolored region of the map in the final display to make it look like 2nd image