Skip to content

Commit

Permalink
fixes #1102
Browse files Browse the repository at this point in the history
  • Loading branch information
rhijmans committed Apr 9, 2023
1 parent 525943d commit 6545cac
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions R/plot_raster.R
Original file line number Diff line number Diff line change
Expand Up @@ -530,8 +530,9 @@ prettyNumbs <- function(x, digits) {
}
if (!is.null(alpha)) {
if (!inherits(alpha, "SpatRaster")) {
cols <- grDevices::rgb(t(grDevices::col2rgb(cols)), alpha=alpha[1]*255, maxColorValue=255)
}
alpha <- alpha[1] * 255
cols <- grDevices::rgb(t(grDevices::col2rgb(cols)), alpha=alpha, maxColorValue=255)
}
} else {
alpha <- 255
}
Expand Down

0 comments on commit 6545cac

Please sign in to comment.