Diff of /R/palettes.R [000000] .. [dfe06d]

Switch to unified view

a b/R/palettes.R
1
#' Color palettes used in outbreaker
2
#'
3
#' These functions are different color palettes (color-generating functions)
4
#' used in outbreaker.
5
#'
6
#' @rdname palettes
7
#'
8
#' @aliases outbreaker_palettes chains_pal
9
#'
10
#' @author Thibaut Jombart (\email{thibautjombart@@gmail.com})
11
#'
12
#' @param n a number of colors to be created
13
#'
14
#' @export
15
#'
16
#' @importFrom grDevices colorRampPalette
17
#'
18
#' @examples
19
#' plot(1:8, col = chains_pal(8), cex = 10, pch = 20)
20
#'
21
chains_pal <- function(n) {
22
    colorRampPalette(c("#660033", "#339966", "#cccc00", "#333399"))(n)
23
}
24
25
#' @rdname palettes
26
#' @export
27
#' @aliases cases_pal
28
cases_pal <- function(n) {
29
    ## This was the viridis palette
30
    ## cols <- c("#440154FF", "#482878FF", "#3E4A89FF", "#31688EFF",
31
    ##           "#26828EFF", "#1F9E89FF", "#35B779FF", "#6DCD59FF",
32
    ##           "#B4DE2CFF", "#FDE725FF")
33
34
35
    ## This one is taken from epicontacts
36
    cols <- c("#ccddff", "#79d2a6", "#ffb3b3", "#a4a4c1","#ffcc00", "#ff9f80",
37
              "#ccff99", "#df9fbf","#ffcc99", "#cdcdcd")
38
39
    colorRampPalette(cols)(n)
40
41
}