R/colors.R

Defines functions choose_dark_or_light

choose_dark_or_light <- function(x, dark = NULL, light = NULL, strength = 0.75) {
  dark <- dark %||% prismatic::clr_darken(x, shift = strength)
  light <- light %||% prismatic::clr_lighten(x, shift = strength)
  prismatic::best_contrast(x, c(dark, light))
}

Try the countdown package in your browser

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

countdown documentation built on Aug. 16, 2022, 5:15 p.m.