powered by
Creates a palette for the current session for a divergent-color graphic with a non-symmetric range. Based on ideas from Maureen Kennedy, Nick Povak, and Alina Cansler.
divergentColors(start.color, end.color, min.value, max.value, mid.value = 0, mid.color = "white")# S4 method for character,character,numeric,numeric divergentColors(start.color, end.color, min.value, max.value, mid.value = 0, mid.color = "white")
# S4 method for character,character,numeric,numeric divergentColors(start.color, end.color, min.value, max.value, mid.value = 0, mid.color = "white")
Start colour to be passed to colorRampPalette.
colorRampPalette
End colour to be passed to colorRampPalette.
Numeric minimum value corresponding to start.colour. If attempting to change the color of a RasterLayer, this can be set to minValue(RasterObject).
start.colour
RasterLayer
minValue(RasterObject)
Numeric maximum value corresponding to end.colour. If attempting to change the color of a RasterLayer, this can be set to maxValue(RasterObject).
end.colour
maxValue(RasterObject)
Numeric middle value corresponding to mid.colour. Default is 0.
mid.colour
0
Middle colour to be passed to colorRampPalette. Defaults to "white".
"white"
A diverging colour palette.
# NOT RUN { divergentColors("darkred", "darkblue", -10, 10, 0, "white") # }
Run the code above in your browser using DataLab