Skip to content

Commit

Permalink
rgb with na values fixed (#910)
Browse files Browse the repository at this point in the history
  • Loading branch information
mtennekes committed Aug 5, 2024
1 parent 6c6e0bb commit f916c7e
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion R/tmapScaleRGB.R
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ tmapScaleRGB_RGBA = function(xlist, scale, legend, chart, o, aes, layer, layer_a

if (any(isna)) {
values = rep(scale$value.na, n)
values[!isna] = do.call(grDevices::rgb, c(xlist, list(maxColorValue = scale$maxValue)))
values[!isna] = do.call(grDevices::rgb, c(lapply(xlist, function(xl) xl[!isna]), list(maxColorValue = scale$maxValue)))
} else {
values = do.call(grDevices::rgb, c(xlist, list(maxColorValue = scale$maxValue)))
}
Expand Down

0 comments on commit f916c7e

Please sign in to comment.