🍑 Pomological plot theme for ggplot2
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.

45 lines
1.3KB

  1. pomological_palette <- c(
  2. "#c03728" #red
  3. ,"#919c4c" #green darkish
  4. ,"#fd8f24" #orange brighter
  5. ,"#f5c04a" #yelloww
  6. ,"#e68c7c" #pink
  7. ,"#828585" #light grey
  8. ,"#c3c377" #green light
  9. ,"#4f5157" #darker blue/grey
  10. ,"#6f5438" #lighter brown
  11. )
  12. pomological_base <- list(
  13. "paper" = "#fffeea",
  14. "paper_alt" = "#f8eed1",
  15. "light_line" = "#efe1c6",
  16. "medium_line" = "#a89985",
  17. "darker_line" = "#6b452b",
  18. "black" = "#3a3e3f",
  19. "dark_blue" = "#2b323f"
  20. )
  21. #' Pomological Color and Fill Scales
  22. #'
  23. #' Color scales based on the USDA Pomological Watercolors paintings.
  24. #'
  25. #' @references https://usdawatercolors.nal.usda.gov/pom
  26. #' @seealso [ggplot2::scale_colour_discrete] [ggplot2::scale_fill_discrete]
  27. #' @inheritDotParams ggplot2::discrete_scale
  28. #' @name scale_pomological
  29. NULL
  30. pomological_pal <- function() scales::manual_pal(pomological_palette)
  31. #' @rdname scale_pomological
  32. #' @export
  33. scale_colour_pomological <- function(...) ggplot2::discrete_scale("colour", "pomological", pomological_pal(), ...)
  34. #' @rdname scale_pomological
  35. #' @export
  36. scale_color_pomological <- scale_colour_pomological
  37. #' @rdname scale_pomological
  38. #' @export
  39. scale_fill_pomological <- function(...) ggplot2::discrete_scale('fill', 'pomological', pomological_pal(), ...)