R/colour_brighten.R

Defines functions colour_brighten

colour_brighten <- function(cols, pcts) {
  rgb_mat <- 1 - grDevices::col2rgb(cols) / 255
  mat <- (1 - sweep(rgb_mat, 2, pcts, "*"))
  grDevices::rgb(mat[1, ], mat[2, ], mat[3, ])
}

Try the dyngen package in your browser

Any scripts or data that you put into this service are public.

dyngen documentation built on April 1, 2026, 9:07 a.m.