R/gl.colors.R
gl.colors.Rd
This is a helper function that supports the creation of color palettes for all plotting functions.
gl.colors(type = 2)
the type of color or palette. Can be "2" [two colors], "2c" [two colors contrast], "3" [three colors], "4" [four colors], "pal" [need to be specify the palette type and the number of colors ]. A palette of colors can be specified via "div" [divergent], "dis" [discrete], "con" [convergent], "vir" [viridis]. Be aware a palette needs the number of colors specified as well. It returns a function and therefore the number of colors needs to be a part of the function call. Check the examples to see how this works.
gl.colors(2)
#> [1] "#3B9AB2" "#78B7C5"
gl.colors("2")
#> [1] "#3B9AB2" "#78B7C5"
gl.colors("2c")
#> [1] "deeppink" "chartreuse3"
#five discrete colors
gl.colors(type="dis")(5)
#> [1] "#F8766D" "#A3A500" "#00BF7D" "#00B0F6" "#E76BF3"
#seven divergent colors
gl.colors("div")(7)
#> [1] "#3B9AB2" "#63ADBE" "#9EBE91" "#EBCC2A" "#E4B80E" "#E67D00" "#F21A00"