colt_theme: Create and set color themes

Description Usage Arguments Value Examples

View source: R/colt_theme.R

Description

Colt comes with two default color themes: clt_theme_light and clt_theme_dark. A colt_theme is just a list of functions, so it is easy to create your own theme. Use set_colt_theme() to switch between themes.

Usage

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
colt_theme(clt_default = crayon:::mypaste, clt_h1 = crayon:::mypaste,
  clt_h2 = crayon:::mypaste, clt_chr = crayon:::mypaste,
  clt_chr_accent = crayon:::mypaste, clt_chr_subtle = crayon:::mypaste,
  clt_true = crayon:::mypaste, clt_false = crayon:::mypaste,
  clt_maybe = crayon:::mypaste, clt_num = crayon:::mypaste,
  clt_num_accent = crayon:::mypaste, clt_num_subtle = crayon:::mypaste,
  clt_bg = crayon:::mypaste, clt_bg_subtle = crayon:::mypaste,
  clt_bg_accent = crayon:::mypaste, clt_na = crayon:::mypaste,
  clt_nan = crayon:::mypaste, clt_inf = crayon:::mypaste,
  clt_null = crayon:::mypaste, clt_info = crayon:::mypaste,
  clt_message = crayon:::mypaste, clt_warning = crayon:::mypaste,
  clt_error = crayon:::mypaste, clt_emph = crayon:::mypaste,
  clt_emph2 = crayon:::mypaste)

set_theme(x)

Arguments

clt_default

Default text style

clt_h1

Header Level 1

clt_h2

Header Level 2

clt_chr

Text

clt_chr_accent

Text (accented)

clt_chr_subtle

Text (subtle)

clt_true

TRUE

clt_false

FALSE

clt_maybe

Undecided

clt_num

Numeric values

clt_num_accent

Numeric values (accented)

clt_num_subtle

Numeric values (subtle)

clt_bg

Text background

clt_bg_subtle

Text background (subtle)

clt_bg_accent

Text background (accented)

clt_na

NA values

clt_nan

NAN values

clt_inf

INF values

clt_null

NULL values

clt_info

INFO level messages

clt_message

MESSAGE level messages

clt_warning

Warnings

clt_error

Errors

clt_emph

Emphasis

clt_emph2

stronger Emphasis

x

A colt_theme Object. If x is NULL, colors will be switched off

Value

colt_theme() creates a new colt_theme Object.

set_theme() returns the input theme Objects invisibly.

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
mytheme <- colt_theme(
  clt_h1 = crayon::combine_styles(crayon::red, crayon::bold)
)

mytheme  # preview theme

cat(clt_h1("Important"))

set_theme(mytheme)
cat(clt_h1("Important"))

set_theme(clt_theme_light)
cat(clt_h1("Important"))

colt documentation built on May 2, 2019, 8:52 a.m.