Quellcode durchsuchen

Fill in documentation for utils

tags/v0.1.1
Garrick Aden-Buie vor 8 Jahren
Ursprung
Commit
a790290027
3 geänderte Dateien mit 25 neuen und 11 gelöschten Zeilen
  1. +11
    -6
      R/utils.R
  2. +5
    -0
      man/apply_alpha.Rd
  3. +9
    -5
      man/google_language_codes.Rd

+ 11
- 6
R/utils.R Datei anzeigen

} }


#' @title Add alpha to hex color #' @title Add alpha to hex color
#' @description Applies alpha (or opacity) to a color in hexadecimal form by
#' converting opacity in the [0, 1] range to hex in the [0, 255] range
#' and appending to the hex color.
#' @inheritParams lighten_darken_color #' @inheritParams lighten_darken_color
#' @param opacity Desired opacity of the output color #' @param opacity Desired opacity of the output color
#' @export #' @export
} }


#' @title List Valid Google Language Codes #' @title List Valid Google Language Codes
#' @description Gives a list of valid Language Codes for Google Fonts, or
#' validates that the language codes given are valid.
#' @seealso [google_font()] #' @seealso [google_font()]
#' @param x Vector of potential Google language codes
#' @param language_codes Vector of potential Google language codes
#' @export #' @export
google_language_codes <- function( google_language_codes <- function(
x = c("latin", "latin-ext", "sinhala", "greek", "hebrew", "vietnamese",
"cyrillic", "cyrillic-ext", "devanagari", "arabic", "khmer",
"tamil", "greek-ext", "thai", "bengali", "gujarati", "oriya",
"malayalam", "gurmukhi", "kannada", "telugu", "myanmar")
language_codes = c("latin", "latin-ext", "sinhala", "greek", "hebrew",
"vietnamese", "cyrillic", "cyrillic-ext", "devanagari", "arabic", "khmer",
"tamil", "greek-ext", "thai", "bengali", "gujarati", "oriya",
"malayalam", "gurmukhi", "kannada", "telugu", "myanmar")
) { ) {
unique(match.arg(x, several.ok = TRUE))
unique(match.arg(language_codes, several.ok = TRUE))
} }


print.google_font <- function(x) { print.google_font <- function(x) {

+ 5
- 0
man/apply_alpha.Rd Datei anzeigen



\item{opacity}{Desired opacity of the output color} \item{opacity}{Desired opacity of the output color}
} }
\description{
Applies alpha (or opacity) to a color in hexadecimal form by
converting opacity in the \link{0, 1} range to hex in the \link{0, 255} range
and appending to the hex color.
}

+ 9
- 5
man/google_language_codes.Rd Datei anzeigen

\alias{google_language_codes} \alias{google_language_codes}
\title{List Valid Google Language Codes} \title{List Valid Google Language Codes}
\usage{ \usage{
google_language_codes(x = c("latin", "latin-ext", "sinhala", "greek",
"hebrew", "vietnamese", "cyrillic", "cyrillic-ext", "devanagari", "arabic",
"khmer", "tamil", "greek-ext", "thai", "bengali", "gujarati", "oriya",
"malayalam", "gurmukhi", "kannada", "telugu", "myanmar"))
google_language_codes(language_codes = c("latin", "latin-ext", "sinhala",
"greek", "hebrew", "vietnamese", "cyrillic", "cyrillic-ext", "devanagari",
"arabic", "khmer", "tamil", "greek-ext", "thai", "bengali", "gujarati",
"oriya", "malayalam", "gurmukhi", "kannada", "telugu", "myanmar"))
} }
\arguments{ \arguments{
\item{x}{Vector of potential Google language codes}
\item{language_codes}{Vector of potential Google language codes}
}
\description{
Gives a list of valid Language Codes for Google Fonts, or
validates that the language codes given are valid.
} }
\seealso{ \seealso{
\code{\link[=google_font]{google_font()}} \code{\link[=google_font]{google_font()}}

Laden…
Abbrechen
Speichern