Nothing
## General helper functions
#' Convert \code{pt} value to \code{lines}
#'
#' @param pt_value Value in \code{pt} to be converted to \code{lines}
#' @return Value in \code{lines}
#' @note Does NOT work if input is not in \code{pt}. Input is returned as is.
pt.to.lines <- function(pt_value){
if(grid::unitType(pt_value) %in% c("pt", "points")){
pt_value <- round(as.numeric(pt_value) * (0.25/5.5), digits = 2)
}
as.numeric(pt_value)
}
#' Check if character is an RGB hexadecimal color value
#' @param x character
#' @return True/False value
#' @export
is.rgb <- function(x){
if(is.null(x)) {
TRUE
} else {
(grepl("#", x) & nchar(x)==7)
}
}
#' Convert R colors to RGB hexadecimal color values
#' @param x character
#' @return hexadecimal color value or "transparent" if is.na
#' @importFrom grDevices col2rgb rgb
#' @export
toRGB <- function(x){
is.transparent <- is.na(x) | x=="transparent"
rgb.mat <- col2rgb(x)
rgb.vec <- rgb(t(rgb.mat), maxColorValue=255)
named.vec <- ifelse(is.transparent, "transparent", rgb.vec)
not.named <- as.character(named.vec)
not.named
}
Any scripts or data that you put into this service are public.
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.