| @@ -13,6 +13,8 @@ | |||
| #' scales::show_col(c(blue_light, blue, blue_dark)) | |||
| #' } | |||
| #' | |||
| #' @return A character string with the lightened or darkened color in | |||
| #' hexadecimal format. | |||
| #' @name lighten_darken_color | |||
| NULL | |||
| @@ -48,6 +50,7 @@ darken_color <- function(color_hex, strength = 0.8) { | |||
| #' scales::show_col(c(blue, blue_transparent)) | |||
| #' } | |||
| #' | |||
| #' @return A character string with added opacity level as hexadecimal characters. | |||
| #' @export | |||
| apply_alpha <- function(color_hex, opacity = 0.5) { | |||
| paste0(color_hex, as.hexmode(round(255 * opacity, 0))) | |||
| @@ -81,6 +84,9 @@ adjust_value_color <- function(color_hex, strength = 0.5) { | |||
| #' scales::show_col(c(light_green, contrast_green, dark_purple, contrast_purple)) | |||
| #' } | |||
| #' | |||
| #' @return The `black` color or `white` color according to which color provides | |||
| #' the greates contrast with the input color. | |||
| #' | |||
| #' @export | |||
| choose_dark_or_light <- function(x, black = "#000000", white = "#FFFFFF") { | |||
| if (is_light_color(x)) eval(black) else eval(white) | |||
| @@ -1005,6 +1005,7 @@ requires_xaringanthemer_env <- function( | |||
| #' theme_xaringan_get_value("header_color") | |||
| #' theme_xaringan_get_value("text_bold_color") | |||
| #' | |||
| #' @return The value of the xaringanthemer style parameter. | |||
| #' @export | |||
| theme_xaringan_get_value <- function(setting, css_file = NULL) { | |||
| requires_xaringanthemer_env(css_file = css_file) | |||
| @@ -41,6 +41,7 @@ call_style_xaringan <- function() { | |||
| #' @param ... Font weights to include, example "400", "400i" | |||
| #' @param languages Font languages to include (dependent on the font.) See | |||
| #' [google_language_codes()]. | |||
| #' @return A `"google_font"` object. | |||
| #' @export | |||
| google_font <- function(family, ..., languages = NULL) { | |||
| base <- "https://fonts.googleapis.com/css?family=" | |||
| @@ -70,6 +71,7 @@ is_google_font <- function(x) inherits(x, "google_font") | |||
| #' validates that the language codes given are valid. | |||
| #' @seealso [google_font()] | |||
| #' @param language_codes Vector of potential Google language codes | |||
| #' @return A vector of Google Font language codes matching `language_codes`. | |||
| #' @export | |||
| google_language_codes <- function( | |||
| language_codes = c( | |||
| @@ -2,6 +2,8 @@ | |||
| #' | |||
| #' These functions in xaringanthemer have been deprecated or renamed. | |||
| #' | |||
| #' @param ... Argumets passed to the new or renamed functions. | |||
| #' @return The result of the new or renamed function. | |||
| #' @name xaringanthemer-deprecated | |||
| NULL | |||
| @@ -8,4 +8,8 @@ | |||
| #' xaringan::moon_reader: | |||
| #' css: xaringan-themer.css | |||
| #' ```` | |||
| # | |||
| #' | |||
| #' @return The CSS styles are written to the file path provided in `outfile` | |||
| #' (by default to `xaringan-themer.css`). If `outfile` is `NULL`, the CSS is | |||
| #' returned directly as a character string. | |||
| #' | |||
| @@ -11,6 +11,9 @@ apply_alpha(color_hex, opacity = 0.5) | |||
| \item{opacity}{Desired opacity of the output color} | |||
| } | |||
| \value{ | |||
| A character string with added opacity level as hexadecimal characters. | |||
| } | |||
| \description{ | |||
| Applies alpha (or opacity) to a color in hexadecimal form by | |||
| converting opacity in the \verb{[0, 1]} range to hex in the \verb{[0, 255]} range | |||
| @@ -15,6 +15,10 @@ choose_dark_or_light(x, black = "#000000", white = "#FFFFFF") | |||
| \item{white}{Text or foreground color or expression, e.g. "#EEE" or | |||
| \code{substitute(lighten_color(x, 0.8))}, if white text provides the best contrast.} | |||
| } | |||
| \value{ | |||
| The \code{black} color or \code{white} color according to which color provides | |||
| the greates contrast with the input color. | |||
| } | |||
| \description{ | |||
| Takes a color input as \code{x} and returns either the black or white color (or | |||
| expression) if dark or light text should be used over the input color for | |||
| @@ -14,6 +14,9 @@ google_font(family, ..., languages = NULL) | |||
| \item{languages}{Font languages to include (dependent on the font.) See | |||
| \code{\link[=google_language_codes]{google_language_codes()}}.} | |||
| } | |||
| \value{ | |||
| A \code{"google_font"} object. | |||
| } | |||
| \description{ | |||
| Builds Google Fonts URL from family name. Extra weights are given in the | |||
| \code{...} parameters. Languages can be specified in \code{langauges} and must one or | |||
| @@ -14,6 +14,9 @@ google_language_codes( | |||
| \arguments{ | |||
| \item{language_codes}{Vector of potential Google language codes} | |||
| } | |||
| \value{ | |||
| A vector of Google Font language codes matching \code{language_codes}. | |||
| } | |||
| \description{ | |||
| Gives a list of valid Language Codes for Google Fonts, or | |||
| validates that the language codes given are valid. | |||
| @@ -17,6 +17,10 @@ darken_color(color_hex, strength = 0.8) | |||
| where 0 is entirely the original color and 1 is entirely white | |||
| (\code{lighten_color()}) or black (\code{darken_color()}).} | |||
| } | |||
| \value{ | |||
| A character string with the lightened or darkened color in | |||
| hexadecimal format. | |||
| } | |||
| \description{ | |||
| Produces a linear blend of the color with white or black. | |||
| } | |||
| @@ -409,6 +409,11 @@ class with the \code{font-family} property. See the \strong{Fonts} section of | |||
| \item{outfile}{Customized xaringan CSS output file name, default is "xaringan-themer.css"} | |||
| } | |||
| \value{ | |||
| The CSS styles are written to the file path provided in \code{outfile} | |||
| (by default to \code{xaringan-themer.css}). If \code{outfile} is \code{NULL}, the CSS is | |||
| returned directly as a character string. | |||
| } | |||
| \description{ | |||
| A duotone theme designed to work well with two complementary | |||
| colors. | |||
| @@ -426,6 +426,11 @@ class with the \code{font-family} property. See the \strong{Fonts} section of | |||
| \item{outfile}{Customized xaringan CSS output file name, default is "xaringan-themer.css"} | |||
| } | |||
| \value{ | |||
| The CSS styles are written to the file path provided in \code{outfile} | |||
| (by default to \code{xaringan-themer.css}). If \code{outfile} is \code{NULL}, the CSS is | |||
| returned directly as a character string. | |||
| } | |||
| \description{ | |||
| An default xaringan theme with a two colors used for color | |||
| accents on select elements (headers, bold text, etc.). | |||
| @@ -428,6 +428,11 @@ class with the \code{font-family} property. See the \strong{Fonts} section of | |||
| \item{outfile}{Customized xaringan CSS output file name, default is "xaringan-themer.css"} | |||
| } | |||
| \value{ | |||
| The CSS styles are written to the file path provided in \code{outfile} | |||
| (by default to \code{xaringan-themer.css}). If \code{outfile} is \code{NULL}, the CSS is | |||
| returned directly as a character string. | |||
| } | |||
| \description{ | |||
| An "inverted" default xaringan theme with a two colors used | |||
| for color accents on select elements (headers, bold text, etc.). | |||
| @@ -413,6 +413,11 @@ class with the \code{font-family} property. See the \strong{Fonts} section of | |||
| \item{outfile}{Customized xaringan CSS output file name, default is "xaringan-themer.css"} | |||
| } | |||
| \value{ | |||
| The CSS styles are written to the file path provided in \code{outfile} | |||
| (by default to \code{xaringan-themer.css}). If \code{outfile} is \code{NULL}, the CSS is | |||
| returned directly as a character string. | |||
| } | |||
| \description{ | |||
| The default xaringan theme with a single color used for color | |||
| accents on select elements (headers, bold text, etc.). | |||
| @@ -414,6 +414,11 @@ class with the \code{font-family} property. See the \strong{Fonts} section of | |||
| \item{outfile}{Customized xaringan CSS output file name, default is "xaringan-themer.css"} | |||
| } | |||
| \value{ | |||
| The CSS styles are written to the file path provided in \code{outfile} | |||
| (by default to \code{xaringan-themer.css}). If \code{outfile} is \code{NULL}, the CSS is | |||
| returned directly as a character string. | |||
| } | |||
| \description{ | |||
| An "inverted" default xaringan theme with a single color used | |||
| for color accents on select elements (headers, bold text, etc.). | |||
| @@ -415,6 +415,11 @@ class with the \code{font-family} property. See the \strong{Fonts} section of | |||
| \item{outfile}{Customized xaringan CSS output file name, default is "xaringan-themer.css"} | |||
| } | |||
| \value{ | |||
| The CSS styles are written to the file path provided in \code{outfile} | |||
| (by default to \code{xaringan-themer.css}). If \code{outfile} is \code{NULL}, the CSS is | |||
| returned directly as a character string. | |||
| } | |||
| \description{ | |||
| A dark monotone theme based around a single color. | |||
| } | |||
| @@ -415,6 +415,11 @@ class with the \code{font-family} property. See the \strong{Fonts} section of | |||
| \item{outfile}{Customized xaringan CSS output file name, default is "xaringan-themer.css"} | |||
| } | |||
| \value{ | |||
| The CSS styles are written to the file path provided in \code{outfile} | |||
| (by default to \code{xaringan-themer.css}). If \code{outfile} is \code{NULL}, the CSS is | |||
| returned directly as a character string. | |||
| } | |||
| \description{ | |||
| A light monotone theme based around a single color. | |||
| } | |||
| @@ -394,6 +394,11 @@ class with the \code{font-family} property. See the \strong{Fonts} section of | |||
| \item{outfile}{Customized xaringan CSS output file name, default is "xaringan-themer.css"} | |||
| } | |||
| \value{ | |||
| The CSS styles are written to the file path provided in \code{outfile} | |||
| (by default to \code{xaringan-themer.css}). If \code{outfile} is \code{NULL}, the CSS is | |||
| returned directly as a character string. | |||
| } | |||
| \description{ | |||
| A dark theme based around on the solarized color scheme. | |||
| Works well with "\code{highlightStyle: solarized-dark}" or | |||
| @@ -394,6 +394,11 @@ class with the \code{font-family} property. See the \strong{Fonts} section of | |||
| \item{outfile}{Customized xaringan CSS output file name, default is "xaringan-themer.css"} | |||
| } | |||
| \value{ | |||
| The CSS styles are written to the file path provided in \code{outfile} | |||
| (by default to \code{xaringan-themer.css}). If \code{outfile} is \code{NULL}, the CSS is | |||
| returned directly as a character string. | |||
| } | |||
| \description{ | |||
| A light theme based around on the solarized color scheme. | |||
| Works well with "\code{highlightStyle: solarized-dark}" or | |||
| @@ -400,6 +400,11 @@ class with the \code{font-family} property. See the \strong{Fonts} section of | |||
| \item{outfile}{Customized xaringan CSS output file name, default is "xaringan-themer.css"} | |||
| } | |||
| \value{ | |||
| The CSS styles are written to the file path provided in \code{outfile} | |||
| (by default to \code{xaringan-themer.css}). If \code{outfile} is \code{NULL}, the CSS is | |||
| returned directly as a character string. | |||
| } | |||
| \description{ | |||
| Creates a customized Xaringan theme CSS file. | |||
| } | |||
| @@ -16,6 +16,9 @@ lets you create a \pkg{ggplot2} theme for your \pkg{xaringan} slides, even | |||
| if you have only saved your theme CSS file and you aren't creating your | |||
| CSS theme with \pkg{xaringanthemer} in your slides' source file.} | |||
| } | |||
| \value{ | |||
| The value of the xaringanthemer style parameter. | |||
| } | |||
| \description{ | |||
| A helper function to retrieve the value of style settings as set by a | |||
| xaringanthemer style function, for use in plotting and other circumstances. | |||
| @@ -37,6 +37,12 @@ solarized_light(...) | |||
| solarized_dark(...) | |||
| } | |||
| \arguments{ | |||
| \item{...}{Argumets passed to the new or renamed functions.} | |||
| } | |||
| \value{ | |||
| The result of the new or renamed function. | |||
| } | |||
| \description{ | |||
| These functions in xaringanthemer have been deprecated or renamed. | |||