Learn R Programming

terminalgraphics (version 0.2.1)

term_background: Get the colors used in the terminal

Description

Get the colors used in the terminal

Usage

term_background()

term_foreground()

term_palette()

Arguments

Value

term_background and term_foreground will return a length 1 vector with a color. term_palette will return a vector of colors.

Details

Getting the color palette used in the terminal is terminal specific. Currently only the kitty terminal is supported. For other terminals default colors are returned. Unless set using options (see below).

When the option term_background is set, that is returned by term_background(). The same with the options term_foreground and term_palette by term_foreground() and term_palette() respectively.

See Also

kitty_colors for the functions returning the specific colors used in the kitty terminal. Also see term_color_mode which is used to determine the color mode.

Examples

Run this code
term_background()

options(term_background = "black", term_foreground = "white", 
  term_palette = grDevices::hcl.colors("Pastel1", n = 9),
  term_col = TRUE)
# term_col enables automatic use of the colors by tgp() and sixel()

Run the code above in your browser using DataLab