Skip to content

Commit cba97ee

Browse files
thematic
1 parent 307f735 commit cba97ee

File tree

2 files changed

+31
-0
lines changed

2 files changed

+31
-0
lines changed

DESCRIPTION

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,7 @@ Suggests:
3636
plotly,
3737
rsconnect (>= 0.8.26),
3838
testthat (>= 3.1.7),
39+
thematic,
3940
withr,
4041
xfun
4142
VignetteBuilder:

R/theme.R

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -132,3 +132,33 @@ plotly_theme_brand <- function(brand_yml) {
132132
brand <- yaml::yaml.load_file(brand_yml)
133133
plotly_theme_colors(brand$color$background, brand$color$foreground)
134134
}
135+
136+
137+
#' Create a thematic theme using background and foreground colors
138+
#'
139+
#' Create a thematic theme that uses the specified background and
140+
#' foreground colors.
141+
#'
142+
#' @param bg The background color
143+
#' @param fg The foreground color
144+
#'
145+
#' @export
146+
thematic_theme_colors <- function(bg, fg) {
147+
(function() {
148+
thematic::thematic_rmd(
149+
bg = bg,
150+
fg = fg,
151+
)})
152+
}
153+
154+
#' Create a thematic theme from a brand.yml file
155+
#'
156+
#' Create a thematic theme that uses colors from the brand file.
157+
#'
158+
#' @param brand_yml The path to the brand.yml file
159+
#'
160+
#' @export
161+
thematic_theme_brand <- function(brand_yml) {
162+
brand <- yaml::yaml.load_file(brand_yml)
163+
thematic_theme_colors(brand$color$background, brand$color$foreground)
164+
}

0 commit comments

Comments
 (0)