Hey,
Create a function using colorNumeric.Factor/bins. Then call the function using field for color inside marker function.
Syntax of color* functions: color*(palette, domain,reverse,....)
Ex:
pal <- colorNumeric(c("green","yellow",,"red"), domain = NULL,reverse = TRUE)
leaflet(quakes) %>% addTiles() %>%
addCircleMarkers(
color = pal(sort(ozone$median)),
stroke = FALSE, fillOpacity = 0.5,
radius = 2.2
)