R/occolors.R

Defines functions occolors

Documented in occolors

occolors <-
function(theme)
{
    if (missing(theme))
        theme <-getOption("ocoptions")$theme
    if (is.function(theme))
        return(theme)
    if (length(theme) == 1L) {
        theme <- match.arg(theme, c("br", "gr", "bw"))
        theme <- switch(theme,
            "br" = c("#2c7bb6", "#abd9e9", "#ffffbf",
                "#fdae61", "#d7191c"), # bu-yl-rd
            "gr" = c("#1a9641", "#a6d96a", "#ffffbf",
                "#fdae61", "#d7191c"), # gr-yl-rd
            "bw" = col2gray(c("#2c7bb6", "#abd9e9", "#ffffbf",
                "#fdae61", "#d7191c"))) # bw
    }
    colorRampPalette(theme)
}
psolymos/opticut documentation built on Nov. 27, 2022, 11:29 a.m.