Skip to contents

Set a color theme for a Trelliscope display

Usage

set_theme(
  trdf,
  primary = "#448aff",
  primary2 = "#4dabf5",
  primary3 = "#2e60b1",
  background = "#FEFEFE",
  background2 = "#EBEBEB",
  background3 = "#E0E0E0",
  bars = "#FFAE25",
  text = "#000",
  text2 = "#FFF",
  button_text = "#757575",
  text_disabled = "#BCBCBC",
  error = "#ff5252",
  font_family = "\"Poppins\", sans-serif",
  logo = NULL
)

Arguments

trdf

A trelliscope data frame created with as_trelliscope_df()

primary

The primary color which applies to the main controls in the app (buttons, navigation icons, checkboxes, etc.).

primary2

The second-level primary color which applies to hover states, etc. Typically a slightly lighter shade of the primary color.

primary3

The third-level primary color, mainly used for the fullscreen button. Typically a slightly darker shade of the primary color.

background

The background color of the app.

background2

The second-level background color used in various components and headers. Typically a slightly lighter or darker shade of the background color.

background3

The third-level background color used for inactive filter bars, sub-header background, component outlines, etc. Typically a slightly lighter or darker shade of the background color.

bars

Color used for highlighted bars in the filter graphs (histogram and bar chart).

text

The general text color used in the app.

text2

The secondary text color used in the header, etc. Should be a contrasting color to the primary color.

button_text

The text color used for buttons. Should be a contrasting color to the primary color.

text_disabled

The text color used for disabled buttons, etc.

error

The color used for error messages.

font_family

The font family to use in the app. Default is "Poppins". Note that many aspects of the app are styled with this font, so changing it may result in less-attractive styling.

URL (relative or absolute) to a logo image to include in the header.

Examples

x <- mars_rover |>
  as_trelliscope_df(name = "mars rover") |>
  set_theme(
    primary = "#c80000",
    primary2 = "#f00000",
    primary3 = "#960000",
    background = "#222222",
    background2 = "#444444",
    background3 = "#333333",
    bars = "#c80000",
    text = "#ffffff",
    text2 = "#ffffff",
    text_disabled = "#bcbcbc",
    logo = rover_icon_b64
  )
#>  Using the variable "id" to uniquely identify each row of the data.