-
Notifications
You must be signed in to change notification settings - Fork 1
/
colours.R
72 lines (58 loc) · 1.65 KB
/
colours.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
###########################################################
# COLOURS
#
# Sample WHO colour schemes.
#
# SOURCE:
# https://apps.who.int/gho/data/design-language/design-system/colors/
#
###########################################################
# ---------------------------------------------------------
# Primary colour creation and indexing function
# ---------------------------------------------------------
colours_who = function(type, n) {
# Call colour map according to type
colour_fn = paste1("colours_who", type)
# Index sdesired number of colours
colours = get(colour_fn)()[seq_len(n)]
return(colours)
}
# ---------------------------------------------------------
# Colour palette: categorical
# ---------------------------------------------------------
colours_who_logo = function() {
# WHO logo colours
colours = c(
"#009CDE", # Vibrant blue
"#001F58") # Navy blue
return(colours)
}
# ---------------------------------------------------------
# Colour palette: categorical
# ---------------------------------------------------------
colours_who_category = function() {
# 6 colours and 1 grey
colours = c(
"#f4a81d",
"#f26829",
"#bd53bd",
"#6363c0",
"#008dc9",
"#40bf73",
"#cccccc")
return(colours)
}
# ---------------------------------------------------------
# Colour palette: categorical
# ---------------------------------------------------------
colours_who_region = function() {
# 1 colour per region
colours = c(
AFR = "#6363c0",
AMR = "#f26829",
EMR = "#bd53bd",
EUR = "#008dc9",
SEAR = "#40bf73",
WPR = "#f4a81d")
return(colours)
}