I want to plot a raster with custom color range in ggplot but failed to create color palette with colors and raster values.
How can I customize color palette like this? please help me with some reference or codes. I can't write the code for plotting with this type of range.
here is the information of the values and colors in rgba.
$Band_index
[1] 1
$color
$color[[1]]
$color[[1]]$value
[1] "-11.075455892653693"
$color[[1]]$r
[1] 0
$color[[1]]$g
[1] 0
$color[[1]]$b
[1] 255
$color[[1]]$a
[1] 255
$color[[2]]
$color[[2]]$value
[1] "-10.11992481776646"
$color[[2]]$r
[1] 102
$color[[2]]$g
[1] 153
$color[[2]]$b
[1] 0
$color[[2]]$a
[1] 255
$color[[3]]
$color[[3]]$value
[1] "4.816534615997083"
$color[[3]]$r
[1] 102
$color[[3]]$g
[1] 102
$color[[3]]$b
[1] 0
$color[[3]]$a
[1] 255
$color[[4]]
$color[[4]]$value
[1] "64.4114990234375"
$color[[4]]$r
[1] 255
$color[[4]]$g
[1] 255
$color[[4]]$b
[1] 255
$color[[4]]$a
[1] 255