Skip to content

Commit

Permalink
Add website link at import
Browse files Browse the repository at this point in the history
  • Loading branch information
VEZY committed May 20, 2020
1 parent ac44af4 commit 85a2077
Showing 1 changed file with 23 additions and 0 deletions.
23 changes: 23 additions & 0 deletions R/zzz.R
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
text_col <- function(x) {
# This function is adapted from: https://github.com/tidyverse/tidyverse
# If RStudio not available, messages already printed in black
if (!rstudioapi::isAvailable()) {
return(x)
}

if (!rstudioapi::hasFun("getThemeInfo")) {
return(x)
}

theme <- rstudioapi::getThemeInfo()

if (isTRUE(theme$dark)) crayon::white(x) else crayon::black(x)

}

.onAttach <- function(libname, pkgname) {
packageStartupMessage(
text_col(paste("Learn CroPlotR at:",
crayon::blue$underline$bold("https://SticsRPacks.github.io/CroPlotR")))
)
}

0 comments on commit 85a2077

Please sign in to comment.