😎 Give your xaringan slides some style
Du kan inte välja fler än 25 ämnen Ämnen måste starta med en bokstav eller siffra, kan innehålla bindestreck ('-') och vara max 35 tecken långa.

26 lines
861B

  1. % Generated by roxygen2: do not edit by hand
  2. % Please edit documentation in R/utils.R
  3. \name{choose_dark_or_light}
  4. \alias{choose_dark_or_light}
  5. \title{Choose dark or light color}
  6. \usage{
  7. choose_dark_or_light(x, black = "#000", white = "#FFF")
  8. }
  9. \arguments{
  10. \item{x}{The background color}
  11. \item{black}{Text or foreground color, e.g. "#222" or
  12. \code{substitute(darken_color(x, 0.8))}, if black text provides the best contrast.}
  13. \item{white}{Text or foreground color or expression, e.g. "#EEE" or
  14. \code{substitute(lighten_color(x, 0.8))}, if white text provides the best contrast.}
  15. }
  16. \description{
  17. Takes a color input as \code{x} and returns either the black or white color (or
  18. expression) if dark or light text should be used over the input color for
  19. best contrast. Follows W3C Recommendations.
  20. }
  21. \references{
  22. \url{https://stackoverflow.com/a/3943023/2022615}
  23. }