Type: Package
Title: Command-Line Color Themes
Version: 0.1.1
Maintainer: Stefan Fleck <stefan.b.fleck@gmail.com>
Description: A collection of command-line color styles based on the 'crayon' package. 'Colt' styles are defined in themes that can easily be switched, to ensure command line output looks nice on dark as well as light consoles.
License: MIT + file LICENSE
Imports: crayon (≥ 1.3.4)
Encoding: UTF-8
LazyData: true
RoxygenNote: 6.0.1
Suggests: knitr, rmarkdown, rstudioapi
Depends: R (≥ 2.10)
URL: https://github.com/s-fleck/colt
BugReports: https://github.com/s-fleck/colt/issues
NeedsCompilation: no
Packaged: 2017-10-10 04:14:06 UTC; hoelk
Author: Stefan Fleck [aut, cre]
Repository: CRAN
Date/Publication: 2017-10-10 04:20:30 UTC

Colt - CLI color themes for R

Description

Colt is aimed at package developers that want to create themeable command line output. It is a simple wrapper around the crayon package.

Author(s)

Maintainer: Stefan Fleck stefan.b.fleck@gmail.com

See Also

Useful links:


Colt Theme for Dark Consoles

Description

Colt Theme for Dark Consoles

See Also

colt_theme


Colt Theme for Light Consoles

Description

Colt Theme for Light Consoles

See Also

colt_theme


Colt style elements

Description

Colt style elements

Usage

clt_default(x, fun = options("colt.theme")[[1]]$clt_default)

clt_h1(x, fun = options("colt.theme")[[1]]$clt_h1)

clt_h2(x, fun = options("colt.theme")[[1]]$clt_h2)

clt_chr(x, fun = options("colt.theme")[[1]]$clt_chr)

clt_chr_accent(x, fun = options("colt.theme")[[1]]$clt_chr_accent)

clt_chr_subtle(x, fun = options("colt.theme")[[1]]$clt_chr_subtle)

clt_true(x, fun = options("colt.theme")[[1]]$clt_true)

clt_false(x, fun = options("colt.theme")[[1]]$clt_false)

clt_maybe(x, fun = options("colt.theme")[[1]]$clt_maybe)

clt_num(x, fun = options("colt.theme")[[1]]$clt_num)

clt_num_accent(x, fun = options("colt.theme")[[1]]$clt_num_accent)

clt_num_subtle(x, fun = options("colt.theme")[[1]]$clt_num_subtle)

clt_bg(x, fun = options("colt.theme")[[1]]$clt_bg)

clt_bg_subtle(x, fun = options("colt.theme")[[1]]$clt_bg_subtle)

clt_bg_accent(x, fun = options("colt.theme")[[1]]$clt_bg_accent)

clt_na(x, fun = options("colt.theme")[[1]]$clt_na)

clt_nan(x, fun = options("colt.theme")[[1]]$clt_nan)

clt_inf(x, fun = options("colt.theme")[[1]]$clt_inf)

clt_null(x, fun = options("colt.theme")[[1]]$clt_null)

clt_info(x, fun = options("colt.theme")[[1]]$clt_info)

clt_message(x, fun = options("colt.theme")[[1]]$clt_message)

clt_warning(x, fun = options("colt.theme")[[1]]$clt_warning)

clt_error(x, fun = options("colt.theme")[[1]]$clt_error)

clt_emph(x, fun = options("colt.theme")[[1]]$clt_emph)

clt_emph2(x, fun = options("colt.theme")[[1]]$clt_emph2)

Arguments

x

a character vector

fun

a styling function


Create and set color themes

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

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

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"))


Printing Colt Themes

Description

Printing Colt Themes

Usage

## S3 method for class 'colt_theme'
print(x, ...)

Arguments

x

a colt_theme

...

ignored