Learn R Programming

osmplotr (version 0.1-3)

adjust_colours: adjust_colours

Description

Adjusts a given colour by lightening or darkening it by the specified amount. Adjustments are made in RGB space, for limitations of which see ?convertColor

Usage

adjust_colours(cols = NULL, adj = 0, plot = FALSE)

Arguments

cols
A vector of R colours (for allowable formats of which, see ?col2rgb).
adj
A number between -1 and 1 determining how much to lighten (positive values) or darken (negative values) the colours.
plot
If true, generates a plot to allow visual comparison of original and adjusted colours

Value

  • Corresponding vector of adjusted colours (as hexadecimal strings)

Examples

Run this code
library (wesanderson)
cols <- adjust_colours (wes_palette ("GrandBudapest"), adj=-0.2, plot=TRUE)

Run the code above in your browser using DataLab