😎 Give your xaringan slides some style
您最多选择25个主题 主题必须以字母或数字开头,可以包含连字符 (-),并且长度不得超过35个字符

28 行
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. }