Skip to content

Commit

Permalink
fix bug in 'changeColors()' where using 202+ colors was breaking it
Browse files Browse the repository at this point in the history
  • Loading branch information
dfriend21 committed Nov 23, 2024
1 parent e88c8a7 commit 1f9c834
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions R/changeColors.R
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,11 @@ changeColors <- function(map, className, colors){
changeColorsDependencies()
)

if (length(colors) > 201) {
inds <- round(seq(0, length(colors), length.out = 201))
colors <- colors[inds]
}

cols <- paste0(col2hex(colors), collapse = ", ")
if (inherits(map, "leaflet_proxy")) {
leaflet::invokeMethod(map,
Expand Down

0 comments on commit 1f9c834

Please sign in to comment.