-
Notifications
You must be signed in to change notification settings - Fork 1
/
theme_darker.R
135 lines (128 loc) · 3.85 KB
/
theme_darker.R
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
# An attempt at an all dark theme.
theme_darker <- function (base_size = 11,
base_family = "InputMono")
{
# Colors
vividchalk_cyan <- "#339999"
vividchalk_magenta <- "#9933CC"
vividchalk_yellow <- "#FFCC00"
vividchalk_green <- "#66FF00"
# TODO: orange
vividchalk_brown <- "#FF6600"
vividchalk_lightcyan <- "#AAFFFF"
vividchalk_grey <- "#AAAA77"
vividchalk_darkgreen <- "#33AA00"
vividchalk_darkcyan <- "#44B4CC"
vividchalk_altyellow <- "#DDE93D"
half_line <- base_size / 2
background_color <- "#333333"
theme(
line = element_line(
colour = "black",
size = 0.5,
linetype = 1,
lineend = "butt"
),
rect = element_rect(
fill = "white",
colour = "black",
size = 0.5,
linetype = 1
),
text = element_text(
family = base_family,
face = "plain",
colour = "white",
size = base_size,
lineheight = 0.9,
hjust = 0,
# Align left
vjust = 0.5,
angle = 0,
margin = margin(),
debug = FALSE
),
axis.line = element_blank(),
axis.text = element_text(size = rel(0.8), colour = "white"),
axis.text.x = element_text(
margin = margin(t = 0.8 * half_line / 2),
vjust = 1,
hjust = 0.5,
color = "grey50"
),
axis.text.y = element_text(
margin = margin(r = 0.8 * half_line / 2),
hjust = 1,
color = "grey50"
),
axis.ticks = element_line(colour = "grey20"),
axis.ticks.length = unit(half_line / 2, "pt"),
axis.title.x = element_text(margin = margin(
t = 0.8 * half_line,
b = 0.8 * half_line / 2
)),
axis.title.y = element_text(
angle = 90,
margin = margin(r = 0.8 * half_line,
l = 0.8 * half_line / 2)
),
legend.background = element_rect(colour = background_color, fill = background_color),
legend.spacing = unit(0.2, "cm"),
legend.key = element_rect(fill = "grey95", colour = "white"),
legend.key.size = unit(1.2, "lines"),
legend.key.height = NULL,
legend.key.width = NULL,
legend.text = element_text(size = rel(0.8)),
legend.text.align = NULL,
legend.title = element_text(hjust = 0),
legend.title.align = NULL,
legend.position = "right",
legend.direction = NULL,
legend.justification = "center",
legend.box = NULL,
panel.background = element_rect(colour = background_color, fill = background_color),
panel.border = element_blank(),
panel.grid.major = element_line(colour = "grey30"),
panel.grid.minor = element_line(colour = "grey20", size = 0.25),
panel.spacing = unit(half_line, "pt"),
panel.margin.x = NULL,
panel.margin.y = NULL,
panel.ontop = FALSE,
strip.background = element_blank(),
strip.text = element_text(colour = "white", size = rel(0.8)),
strip.text.x = element_text(margin = margin(t = half_line,
b = half_line)),
strip.text.y = element_text(
angle = -90,
margin = margin(l = half_line,
r = half_line)
),
strip.switch.pad.grid = unit(0.1, "cm"),
strip.switch.pad.wrap = unit(0.1, "cm"),
plot.background = element_rect(colour = background_color, fill = background_color),
plot.title = element_text(
size = rel(1.2),
margin = margin(b = half_line * 1.2),
face = "bold"
),
plot.title.position = "plot",
plot.margin = margin(half_line, half_line, half_line, half_line * 1.5),
complete = TRUE
)
# +
# scale_fill_manual(
# values = c(
# vividchalk_cyan,
# vividchalk_yellow,
# vividchalk_green,
# # TODO: orange
# vividchalk_brown,
# vividchalk_lightcyan,
# vividchalk_magenta,
# vividchalk_grey,
# vividchalk_darkgreen,
# vividchalk_darkcyan,
# vividchalk_altyellow
# )
# )
}