fmt_get_color_code: Get HTML Color Code of a fmt vector

fmt_get_color_codeR Documentation

Get HTML Color Code of a fmt vector

Description

Get HTML Color Code of a fmt vector

Usage

fmt_get_color_code(x, type = "text", theme = "light", html_24_bit = NULL)

Arguments

x

The fmt vector to get the html color codes from.

type

The style type in set_color_style and get_color_style, "text" to color the text, "bg" to color the background.

theme

For set_color_style and get_color_style, is your console or html table background "light" or "dark" ? Default to RStudio theme.

html_24_bit

Use 24bits colors palettes for html tables : set to "green_red" or "blue_red". Only with mode = "color_code" (not mode = "crayon") and ⁠theme = "light⁠. Default to getOption("tabxplor.color_html_24_bit").

Value

A character vector with html color codes, of the length of the initial vector.

Examples


tabs <- tab(forcats::gss_cat, race, marital, pct = "row", color = "diff")
dplyr::mutate(tabs, across(where(is_fmt), fmt_get_color_code))


BriceNocenti/tablr documentation built on April 12, 2025, 12:56 a.m.