These are a set of convenience functions for standard colour manipulation operations.
Usage
col_shift(col, amount = 10)
col_lighter(col, amount = 10)
col_darker(col, amount = 10)
col_saturate(col, amount = 10)
Arguments
- col
A character vector of colours or a colour palette function.
- amount
A numeric vector giving the change. The interpretation depends on the function:
col_shift()
takes a number between -360 and 360 for shifting hues in HCL space.col_lighter()
andcol_darker()
take a number between -100 and 100 for adding (or subtracting) to the lightness channel in HSL space.col_saturate()
takes a number between -100 and 100 for adding to the saturation channel in HSL space. Negative numbers desaturate the colour.