😎 Give your xaringan slides some style
Du kannst nicht mehr als 25 Themen auswählen Themen müssen entweder mit einem Buchstaben oder einer Ziffer beginnen. Sie können Bindestriche („-“) enthalten und bis zu 35 Zeichen lang sein.

28 Zeilen
693B

  1. % Generated by roxygen2: do not edit by hand
  2. % Please edit documentation in R/color.R
  3. \name{apply_alpha}
  4. \alias{apply_alpha}
  5. \title{Add alpha to hex color}
  6. \usage{
  7. apply_alpha(color_hex, opacity = 0.5)
  8. }
  9. \arguments{
  10. \item{color_hex}{A character string representing a hex color}
  11. \item{opacity}{Desired opacity of the output color}
  12. }
  13. \description{
  14. Applies alpha (or opacity) to a color in hexadecimal form by
  15. converting opacity in the \verb{[0, 1]} range to hex in the \verb{[0, 255]} range
  16. and appending to the hex color.
  17. }
  18. \examples{
  19. blue <- "#0e6ba8"
  20. blue_transparent <- apply_alpha(blue)
  21. if (requireNamespace("scales", quietly = TRUE)) {
  22. scales::show_col(c(blue, blue_transparent))
  23. }
  24. }