Skip to content

Commit

Permalink
feat: add hc_dark_web_theme
Browse files Browse the repository at this point in the history
  • Loading branch information
Nenuial committed Nov 18, 2024
1 parent 14d1c33 commit 2668f5d
Show file tree
Hide file tree
Showing 3 changed files with 76 additions and 0 deletions.
1 change: 1 addition & 0 deletions NAMESPACE
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ export(ggeopal_pal_to_gradient)
export(ggeopal_to_gradient)
export(ggeosave)
export(ggeotheme)
export(hc_dark_web_theme)
export(hc_jerusalem_theme)
export(hc_pomogreen_theme)
export(hc_purple_theme)
Expand Down
72 changes: 72 additions & 0 deletions R/highcharter_themes.R
Original file line number Diff line number Diff line change
Expand Up @@ -427,3 +427,75 @@ hc_web_theme <- function(hc) {
hc |>
highcharter::hc_add_theme(theme)
}

#' @rdname hc_purple_theme
#' @export
hc_dark_web_theme <- function(hc) {
base_colors <- list(
main_color = "#acb5c9",
axis_color = "#b7caed",
title_color = "#ffffff"
)

base_text_style <- list(
fontFamily = "Fira Sans",
color = base_colors$main_color
)

axis_title_style <- list(
fontFamily = "Fira Sans",
color = base_colors$axis_color
)

theme <- highcharter::hc_theme(
colors = wesanderson::wes_palette("GrandBudapest2"),
chart = list(
backgroundColor = "transparent"
),
title = list(
style = list(
color = base_colors$title_color,
fontFamily = "Fira Sans"
)
),
subtitle = list(
style = list(
color = base_colors$title_color,
fontFamily = "Fira Sans"
)
),
legend = list(
itemStyle = base_text_style,
itemHoverStyle = list(
color = base_colors$main_color
)
),
tooltip = list(
style = list(
fontFamily = "Fira Sans"
)
),
caption = list(
style = base_text_style
),
xAxis = list(
labels = list(
style = base_text_style
),
title = list(
style = axis_title_style
)
),
yAxis = list(
labels = list(
style = base_text_style
),
title = list(
style = axis_title_style
)
)
)

hc |>
highcharter::hc_add_theme(theme)
}
3 changes: 3 additions & 0 deletions man/hc_purple_theme.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit 2668f5d

Please sign in to comment.