Skip to contents

Sets a global colour palette used by all plotting functions in phenoscapR. The palette can be a viridis option, a custom gradient defined by 2-3 anchor colours, or a named vector of discrete colours.

Usage

SetPalette(palette)

GetPalette()

Arguments

palette

Character or named character vector. Either:

  • A viridis palette name: "viridis", "magma", "inferno", "plasma", "cividis", "rocket", "mako", "turbo".

  • A character vector of 2-3 hex colours for a custom gradient (e.g. c("#440154", "#21918c", "#fde725")).

  • NULL to return the current palette without changing it.

Value

Invisibly returns the previous palette setting.

Examples

SetPalette("magma")
GetPalette()
#> [1] "magma"

# Custom 3-colour gradient
SetPalette(c("navy", "white", "firebrick"))
GetPalette()
#> [1] "navy"      "white"     "firebrick"

# Reset to default
SetPalette("viridis")