The theme of the chart can be customised with the motif function.

Out-of-the-box G2.js comes with two themes (light), and dark.

You can also customise the motif with the various element* functions.

library(g2r)

data(penguins, package = "palmerpenguins")

g2(penguins, asp(bill_length_mm, bill_depth_mm)) %>% 
  fig_point(asp(color = island, shape = "circle")) %>% 
  motif(
    backgroundColor = "lightgrey",
    colors10 = scales::hue_pal()(3),
    padding = 20,
    elementPoint(
      shape = "circle",
      stroke = 0,
      opacity = 1
    )
)
g2(cars, asp(speed, dist)) %>% 
  fig_point(asp(shape = "circle")) %>% 
  fig_smooth() %>% 
  motif(
    padding = 30,
    brandColor = "orange",
    backgroundColor = "#363636"
  )

Colors

Continuous

gauge_color_viridis
gauge_color_plasma
gauge_color_inferno
gauge_color_magma
gauge_color_neon
gauge_color_lime
gauge_color_orange
gauge_color_pink
gauge_color_std
gauge_color_g2rc
gauge_color_blue
gauge_color_red

Discrete

gauge_color_accent
gauge_color_dark2
gauge_color_paired
gauge_color_pastel1
gauge_color_pastel2
gauge_color_set1
gauge_color_set2
gauge_color_set3
gauge_color_aw
gauge_color_flashy
gauge_color_g2rq
gauge_color_flashy

Diverging

gauge_color_g2rd
gauge_color_brbg
gauge_color_piyg
gauge_color_prgn
gauge_color_puor
gauge_color_rdbu
gauge_color_rdgy
gauge_color_rdylbu
gauge_color_rdylgn
gauge_color_spectral
gauge_color_ryb
gauge_color_bwg