Learn R Programming

terminalgraphics (version 0.1.1)

kitty_colors: Get the colors used in the kitty terminal

Description

Get the colors used in the kitty terminal

Usage

kitty_colors()

kitty_background()

kitty_foreground()

kitty_palette()

Arguments

Value

kitty_colors returns a data.frame with the colors from the theme used by kitty. kitty_background returns the background color (character vector with the hex-code). kitty_foreground returns the foreground color. kitty_palette returns a vector with the 9 main accent colors from the theme.

Details

To get the background and foreground colors, kitten query-terminal is called. To get all colors and the palette kitty @get-colors is called using system. However, for the last to work allow_remote_control needs to be set to true in the config file for kitty.

See Also

term_background, term_foreground, term_palette for functions that try to return the colors used in any terminal. When running in kitty, these will call kitty_background etc.

Examples

Run this code
if (is_kitty()) {
  cat("The background color is '", kitty_background(), "'.")
}

Run the code above in your browser using DataLab