#' geometric emoji
#'
#' @rdname geometric
#' @param size size
#' @param color color
#'
#' @details
#' For `square`:
#' - `size` should be one of `c( "small", "medium", "medium-small", "large" )`
#' - `color` should be "white" or "black"
#'
#' For `diamond`
#' - `size` should be "large" or "small"
#' - `color` should be "orange" or "blue"
#'
#' @examples
#' \dontrun{
#' square( "small", "black" )
#' square( "large", "white" )
#'
#' diamond( "small", "orange")
#' }
#'
#' @importFrom glue glue
#'
#' @export
square <- function(size = c( "small", "medium", "medium-small", "large" ), color = c( "white", "black") ){
size <- match.arg(size)
color <- match.arg(color)
jis <- emo::jis
emoji <- jis$emoji[ jis$name == glue("{color} {size} square") ]
structure(
emoji,
class = c("square", "geometric", "emoji"),
size = size,
color = color
)
}
#' @export
print.square <- function(x, ...) {
NextMethod()
}
#' @rdname geometric
#' @export
diamond <- function( size = c("large", "small"), color = c("orange", "blue") ){
size <- match.arg(size)
color <- match.arg(color)
jis <- emo::jis
emoji <- jis$emoji[ jis$name == glue("{size} {color} diamond") ]
structure(
data$emoji,
class = c("diamond", "geometric", "emoji"),
size = size,
color = color
)
}
#' @export
print.diamond <- function(x, ...) {
NextMethod()
}
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.