getSimpleColoredTblTheme: Get a simple coloured theme.

Description Usage Arguments Value Examples

View source: R/TableThemes.R

Description

Get a simple coloured theme that can be used to style a table into a custom colour scheme.

Usage

1
2
3
4
5
6
7
getSimpleColoredTblTheme(
  parentTable,
  themeName = "coloredTheme",
  colors = NULL,
  fontName = NULL,
  theme = NULL
)

Arguments

parentTable

Owning table.

themeName

The name to use as the new theme name.

colors

The set of colours to use when generating the theme (see the Styling vignette for details). This parameter exists for backward compatibility.

fontName

The name of the font to use, or a comma separated list (for font-fall-back). This parameter exists for backward compatibility.

theme

A simple theme specified in the form of a list. See example for supported list elements (all other elements will be ignored).

Value

A TableStyles object.

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
simpleOrangeTheme <- list(
  fontName="Verdana, Arial",
  fontSize="0.75em",
  headerBackgroundColor = "rgb(237, 125, 49)",
  headerColor = "rgb(255, 255, 255)",
  cellBackgroundColor = "rgb(255, 255, 255)",
  cellColor = "rgb(0, 0, 0)",
  totalBackgroundColor = "rgb(248, 198, 165)",
  totalColor = "rgb(0, 0, 0)",
  borderColor = "rgb(198, 89, 17)"
)
library(basictabler)
tbl <- qtbl(data.frame(a=1:2, b=3:4))
# then
tbl$theme <- simpleOrangeTheme
# or
theme <- getSimpleColoredTblTheme(tbl, theme=simpleOrangeTheme)
# make further changes to the theme
tbl$theme <- simpleOrangeTheme
# theme set, now render table
tbl$renderTable()

basictabler documentation built on June 26, 2021, 5:05 p.m.