ramp | R Documentation |
Returns lightened or darkened colors, vectorised over percentage
.
ramp
is valid for any couple of colors. Functions darken()
and
lighten()
call ramp
to respectively darken and lighten a given color.
ramp(fromcol, tocol, percentage = 50, as_rgb = FALSE) darken(col, percentage = 50, as_rgb = FALSE) lighten(col, percentage = 50, as_rgb = FALSE)
fromcol |
starting color, i.e. |
tocol |
color to nuance |
percentage |
percentage determining the percentage of |
as_rgb |
a logical. Should the color(s) returned as a matrix object? |
col |
the color to be darkened or lightened. |
ramp()
: Returns a shaded color.
darken()
: Darken a color.
lighten()
: Lighten a color.
grDevices::colorRampPalette()
showPalette(ramp("blue", "red", 10 * 3:7)) darken("red", 50) more_reds <- lighten("red", seq(10, 90, 9)) showPalette(more_reds)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.