😎 Give your xaringan slides some style
Vous ne pouvez pas sélectionner plus de 25 sujets Les noms de sujets doivent commencer par une lettre ou un nombre, peuvent contenir des tirets ('-') et peuvent comporter jusqu'à 35 caractères.

36 lines
995B

  1. % Generated by roxygen2: do not edit by hand
  2. % Please edit documentation in R/color.R
  3. \name{lighten_darken_color}
  4. \alias{lighten_darken_color}
  5. \alias{lighten_color}
  6. \alias{darken_color}
  7. \title{Generate lighter or darker version of a color}
  8. \usage{
  9. lighten_color(color_hex, strength = 0.7)
  10. darken_color(color_hex, strength = 0.8)
  11. }
  12. \arguments{
  13. \item{color_hex}{A character string representing a hex color}
  14. \item{strength}{The "strength" of the blend with white or black,
  15. where 0 is entirely the original color and 1 is entirely white
  16. (\code{lighten_color()}) or black (\code{darken_color()}).}
  17. }
  18. \value{
  19. A character string with the lightened or darkened color in
  20. hexadecimal format.
  21. }
  22. \description{
  23. Produces a linear blend of the color with white or black.
  24. }
  25. \examples{
  26. blue <- "#0e6ba8"
  27. blue_light <- lighten_color(blue, strength = 0.33)
  28. blue_dark <- darken_color(blue, strength = 0.33)
  29. if (requireNamespace("scales", quietly = TRUE)) {
  30. scales::show_col(c(blue_light, blue, blue_dark))
  31. }
  32. }