View source: R/adjust_palette.R
| adjust_ltc | R Documentation |
Darken or lighten an entire palette or specific colors within it. Uses the colorspace package for perceptually uniform adjustments.
adjust_ltc(palette_name, amount = 0, which = NULL)
palette_name |
Character or unquoted name. Name of the ltc palette to adjust. |
amount |
Numeric. Amount to adjust lightness (-100 to 100). Negative values darken, positive values lighten. Default is 0 (no change). |
which |
Integer vector. Which colors to adjust (e.g., c(1, 3) for 1st and 3rd). If NULL (default), adjusts all colors. |
A vector of adjusted hex color codes with class "ltc"
# Darken entire palette
adjust_ltc(alger, amount = -20)
# Lighten entire palette
adjust_ltc("maya", amount = 30)
# Darken only specific colors
adjust_ltc(remains, amount = -25, which = c(2, 4))
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.