Marc Kupietz | 5214481 | 2020-12-14 23:41:56 +0100 | [diff] [blame] | 1 | idsBaseFontFamily <- 'Fira Sans Condensed' |
| 2 | |
Marc Kupietz | 161a86a | 2021-02-02 14:40:23 +0100 | [diff] [blame] | 3 | |
| 4 | #' Title |
| 5 | #' |
| 6 | #' @return |
| 7 | #' @export |
| 8 | #' |
| 9 | #' @examples |
| 10 | idsPalette <- function() { |
| 11 | c( |
Marc Kupietz | a371c67 | 2020-12-18 15:56:15 +0100 | [diff] [blame] | 12 | '#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 Kupietz | 161a86a | 2021-02-02 14:40:23 +0100 | [diff] [blame] | 33 | } |
Marc Kupietz | a371c67 | 2020-12-18 15:56:15 +0100 | [diff] [blame] | 34 | |
Marc Kupietz | 161a86a | 2021-02-02 14:40:23 +0100 | [diff] [blame] | 35 | #' Title |
| 36 | #' |
| 37 | #' @return |
| 38 | #' @export |
| 39 | #' |
| 40 | #' @examples |
| 41 | idsPaletteD3 <- function() { |
| 42 | c( |
Marc Kupietz | 5214481 | 2020-12-14 23:41:56 +0100 | [diff] [blame] | 43 | '#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 Kupietz | 161a86a | 2021-02-02 14:40:23 +0100 | [diff] [blame] | 64 | } |
Marc Kupietz | 5214481 | 2020-12-14 23:41:56 +0100 | [diff] [blame] | 65 | |
Marc Kupietz | 161a86a | 2021-02-02 14:40:23 +0100 | [diff] [blame] | 66 | #' Title |
| 67 | #' |
| 68 | #' @return |
| 69 | #' @export |
| 70 | #' |
| 71 | #' @examples |
| 72 | idsPaletteGreyscale <- function() { |
| 73 | c( |
Marc Kupietz | 5214481 | 2020-12-14 23:41:56 +0100 | [diff] [blame] | 74 | "#000000", "#B2B0AD", "#737373", "#D8D7D6", "#B2B0AD", "#8C8984" |
Marc Kupietz | 161a86a | 2021-02-02 14:40:23 +0100 | [diff] [blame] | 75 | ) |
| 76 | } |
Marc Kupietz | 5214481 | 2020-12-14 23:41:56 +0100 | [diff] [blame] | 77 | |
| 78 | backgroundColorDark <- "#2a2a2a" |
| 79 | textColorDark <- "#E0E0E3" |
| 80 | lowContrastColorDark <- "#707073" |
| 81 | highContrastColorDark <- "#F0F0F3" |
| 82 | mediumContrastColorDark <- "#808083" |
| 83 | |
| 84 | backgroundColor <- "#ffffff" |
| 85 | textColor <- "#383838" |
| 86 | highContrastColor <- "#101013" |
| 87 | lowContrastColor <- "#E0E0E3" |
| 88 | mediumContrastColor <- "#404043" |
| 89 | tooltipBackgroundColor <- "#ffffffe0" |
| 90 | boxplotFillColor <- "#505053" |
| 91 | candlestickColor <- "black" |
| 92 | errorbarColor <- "black" |
| 93 | |
Marc Kupietz | a371c67 | 2020-12-18 15:56:15 +0100 | [diff] [blame] | 94 | #' IDS color palette |
| 95 | #' |
| 96 | #' @param palette \code{c("D3", "default")} - use default or (adapted) d3 palette |
Marc Kupietz | 5214481 | 2020-12-14 23:41:56 +0100 | [diff] [blame] | 97 | #' |
| 98 | #' @importFrom scales manual_pal |
| 99 | #' @export |
| 100 | #' |
| 101 | #' @references |
| 102 | #' |
| 103 | #' \url{https://github.com/d3/d3} |
| 104 | #' |
Marc Kupietz | a371c67 | 2020-12-18 15:56:15 +0100 | [diff] [blame] | 105 | ids_pal <- function(palette="default") { |
Marc Kupietz | 161a86a | 2021-02-02 14:40:23 +0100 | [diff] [blame] | 106 | values <- if(palette == "d3" || palette == "D3") idsPaletteD3() else idsPalette() |
Marc Kupietz | 5214481 | 2020-12-14 23:41:56 +0100 | [diff] [blame] | 107 | f <- scales::manual_pal(values) |
| 108 | attr(f, "max_n") <- length(values) |
| 109 | f |
| 110 | } |