View source: R/gt_hulk_color.R
| gt_hulk_col_numeric | R Documentation | 
The hulk name comes from the idea of a diverging purple and green theme that is colorblind safe and visually appealing. It is a useful alternative to the red/green palette where purple typically can indicate low or "bad" value, and green can indicate a high or "good" value.
gt_hulk_col_numeric(
  gt_object,
  columns = NULL,
  domain = NULL,
  ...,
  trim = FALSE
)
gt_object | 
 An existing gt table object of class   | 
columns | 
 The columns wherein changes to cell data colors should occur.  | 
domain | 
 The possible values that can be mapped. For  If   | 
... | 
 Additional arguments passed to   | 
trim | 
 trim the palette to give less intense maximal colors  | 
An object of class gt_tbl.
library(gt) # basic use hulk_basic <- mtcars %>% head() %>% gt::gt() %>% gt_hulk_col_numeric(mpg) hulk_trim <- mtcars %>% head() %>% gt::gt() %>% # trim gives small range of colors gt_hulk_col_numeric(mpg:disp, trim = TRUE) # option to reverse the color palette hulk_rev <- mtcars %>% head() %>% gt::gt() %>% # trim gives small range of colors gt_hulk_col_numeric(mpg:disp, reverse = TRUE)
4-1
Other Colors: 
gt_color_box(),
gt_color_rows()
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.