blob: 046594217a604af1894e6d204a5149ef66d716de [file] [log] [blame]
Marc Kupietz52144812020-12-14 23:41:56 +01001idsBaseFontFamily <- 'Fira Sans Condensed'
2
Marc Kupietz161a86a2021-02-02 14:40:23 +01003
4#' Title
5#'
6#' @return
7#' @export
8#'
9#' @examples
Marc Kupietz556dbd52021-02-04 14:53:21 +010010idsPaletteIDS <- function() {
Marc Kupietz161a86a2021-02-02 14:40:23 +010011 c(
Marc Kupietza371c672020-12-18 15:56:15 +010012 '#F18700',
13 "#1E2662",
14 "#6A7702",
15 "#C10A25",
16 "#009EE3",
17 "#FAF3DE",
18 "#A7C2D2",
19 "#E2E8A4",
20 "#CFBCBD",
21 "#BCE3FA",
22 "#5C401C",
23 "#000000",
24 "#354C32",
25 "#5C131C",
26 "#273582",
27 "#FFE3BF",
28 "#8994E1",
29 "#A3B29E",
30 "#DF9599",
31 "#79B8DB"
32)
Marc Kupietz161a86a2021-02-02 14:40:23 +010033}
Marc Kupietza371c672020-12-18 15:56:15 +010034
Marc Kupietz161a86a2021-02-02 14:40:23 +010035#' Title
36#'
37#' @return
38#' @export
39#'
40#' @examples
41idsPaletteD3 <- function() {
42 c(
Marc Kupietz52144812020-12-14 23:41:56 +010043 '#EB7C31',
44 "#1F77B4",
45 "#2CA02C",
46 "#D62728",
47 "#9467BD",
48 "#8C564B",
49 "#E377C2",
50 "#7F7F7F",
51 "#BCBD22",
52 "#17BECF",
53 "#AEC7E8",
54 "#FFBB78",
55 "#98DF8A",
56 "#FF9896",
57 "#C5B0D5",
58 "#C49C94",
59 "#F7B6D2",
60 "#C7C7C7",
61 "#DBDB8D",
62 "#9EDAE5"
63)
Marc Kupietz161a86a2021-02-02 14:40:23 +010064}
Marc Kupietz52144812020-12-14 23:41:56 +010065
Marc Kupietz161a86a2021-02-02 14:40:23 +010066#' Title
67#'
68#' @return
69#' @export
70#'
71#' @examples
Marc Kupietz556dbd52021-02-04 14:53:21 +010072idsPalettePoly20 <- function() {
73 c(
74 "#EF8700", "#1642FF", "#00D20D", "#FF00CB", "#162E35", "#00C8FC", "#FF004B", "#BBB96A", "#DFA2ED", "#881640", "#22D0AD", "#CF0DF7",
75 "#2E0D95", "#AFB9BD", "#FC4792", "#EBA392", "#1C7C00", "#939CFF", "#AB00A4", "#AF1C00"
76 )
77}
78
79#' Title
80#'
81#' @return
82#' @export
83#'
84#' @examples
Marc Kupietz161a86a2021-02-02 14:40:23 +010085idsPaletteGreyscale <- function() {
86 c(
Marc Kupietz52144812020-12-14 23:41:56 +010087 "#000000", "#B2B0AD", "#737373", "#D8D7D6", "#B2B0AD", "#8C8984"
Marc Kupietz161a86a2021-02-02 14:40:23 +010088 )
89}
Marc Kupietz52144812020-12-14 23:41:56 +010090
Marc Kupietz556dbd52021-02-04 14:53:21 +010091#' Title
92#'
93#' @return
94#' @export
95#'
96#' @examples
97idsPalette <- function() {
98 idsPaletteD3()
99}
100
Marc Kupietz52144812020-12-14 23:41:56 +0100101backgroundColorDark <- "#2a2a2a"
102textColorDark <- "#E0E0E3"
103lowContrastColorDark <- "#707073"
104highContrastColorDark <- "#F0F0F3"
105mediumContrastColorDark <- "#808083"
106
107backgroundColor <- "#ffffff"
108textColor <- "#383838"
109highContrastColor <- "#101013"
110lowContrastColor <- "#E0E0E3"
111mediumContrastColor <- "#404043"
112tooltipBackgroundColor <- "#ffffffe0"
113boxplotFillColor <- "#505053"
114candlestickColor <- "black"
115errorbarColor <- "black"
116
Marc Kupietza371c672020-12-18 15:56:15 +0100117#' IDS color palette
118#'
Marc Kupietz556dbd52021-02-04 14:53:21 +0100119#' @param palette \code{c("d3", "grey", "ids", "poly20")} - default: (adapted) d3 palette
Marc Kupietz52144812020-12-14 23:41:56 +0100120#'
121#' @importFrom scales manual_pal
122#' @export
123#'
124#' @references
125#'
126#' \url{https://github.com/d3/d3}
127#'
Marc Kupietza371c672020-12-18 15:56:15 +0100128ids_pal <- function(palette="default") {
Marc Kupietz556dbd52021-02-04 14:53:21 +0100129 values <- switch(tolower(palette),
130 ids = idsPalette(),
131 gray = idsPaletteGreyscale(),
132 grey = idsPaletteGreyscale(),
133 poly20 = idsPalettePoly20(),
134 idsPaletteD3()
135 )
Marc Kupietz52144812020-12-14 23:41:56 +0100136 f <- scales::manual_pal(values)
137 attr(f, "max_n") <- length(values)
138 f
139}