Skip to content

Commit 5956617

Browse files
committed
adapt theme
1 parent 6b31389 commit 5956617

File tree

1 file changed

+13
-7
lines changed

1 file changed

+13
-7
lines changed

R/theme-defaults.R

Lines changed: 13 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -500,28 +500,34 @@ theme_classic <- function(base_size = 11, base_family = "",
500500
#' @export
501501
#' @rdname ggtheme
502502
theme_transparent <- function(base_size = 11, base_family = "",
503+
header_family = NULL,
503504
base_line_size = base_size / 22,
504-
base_rect_size = base_size / 22) {
505+
base_rect_size = base_size / 22,
506+
ink = "black", paper = alpha(ink, 0)) {
507+
force(ink)
505508
# Based on theme_bw
506509
theme_grey(
507510
base_size = base_size,
508511
base_family = base_family,
512+
header_family = header_family,
509513
base_line_size = base_line_size,
510-
base_rect_size = base_rect_size
514+
base_rect_size = base_rect_size,
515+
ink = ink, paper = paper
511516
) %+replace%
512517
theme(
513518
panel.background = element_blank(),
514519
plot.background = element_blank(),
515520
legend.background = element_blank(),
516521
legend.key = element_blank(),
517522
# theme_bw specifications
518-
panel.border = element_rect(fill = NA, colour = "grey20"),
523+
panel.border = element_rect(fill = NA, colour = col_mix(ink, paper, 0.20)),
519524
# make gridlines dark, same contrast with white as in theme_grey
520-
panel.grid = element_line(colour = "grey92"),
521-
panel.grid.minor = element_line(linewidth = rel(0.5)),
525+
panel.grid = element_line(colour = col_mix(ink, paper, 0.92)),
522526
# contour strips to match panel contour
523-
strip.background = element_rect(fill = "grey85", colour = "grey20"),
524-
527+
strip.background = element_rect(
528+
fill = col_mix(ink, paper, 0.85),
529+
colour = col_mix(ink, paper, 0.20),
530+
),
525531
complete = TRUE
526532
)
527533
}

0 commit comments

Comments
 (0)