R/listOfStyles.R

Defines functions listOfStyles

Documented in listOfStyles

#' listOfStyles
#'
#' @param style
#'
#' @return
#' @export
#'
#' @examples
listOfStyles <- function(style = "basic") {

  styleList <- list(
    colNames = list( ## basic
      fontHeight = 14,
      fontBold = T,
      fontItalic = F,
      fontName = "Calibri",
      fontColor = "#FFFFF9",
      fillBackgroundColor = "#2ca25f",
      fillForegroundColor = "#2ca25f",
      fillPattern = "SOLID_FOREGROUND",
      borderColor = "black",
      borderPosition = c("TOP", "BOTTOM", "LEFT", "RIGHT"),
      borderPen=c("BORDER_THIN", "BORDER_THIN", "BORDER_THIN", "BORDER_THIN") ,
      alignmentH = "ALIGN_RIGHT",
      alignmentV = "VERTICAL_CENTER"
      ),
    basic = list(
      fontHeight = 11,
      fontBold = F,
      fontItalic = F,
      fontName = "Calibri",
      fontColor = "#000005",
      fillBackgroundColor = "white",
      fillForegroundColor = "white",
      fillPattern = "SOLID_FOREGROUND",
      borderColor = "black",
      borderPosition = c("TOP", "BOTTOM", "LEFT", "RIGHT"),
      borderPen= c("BORDER_THIN", "BORDER_THIN", "BORDER_THIN", "BORDER_THIN"),
      alignmentH = "ALIGN_CENTER",
      alignmentV = "VERTICAL_CENTER"
    )
  )

  if (!style %in% names(styleList)) {
    warning(glue::glue("Style: {style} non exists, returing 'basic' style instead"))
    style <- "basic"
  }

  return(styleList[[style]])
}
kiwimic/prettyExcelExpoRt documentation built on Nov. 4, 2019, 3:53 p.m.