paletteer

repository·main·Indexed 21 days ago

https://github.com/emilhvitfeldt/paletteer

A comprehensive collection of color palettes for R that provides a unified interface to access thousands of palettes from various CRAN and GitHub packages. It categorizes palettes into continuous (paletteer_c), discrete fixed-width (paletteer_d), and discrete dynamic (paletteer_dynamic) types, using a "packagename::palettename" syntax. The package also includes specialized scale functions for integration with ggplot2, such as scale_color_paletteer_d().

Tokens
5.9K
Snippets
10
Records
11
Agent score
27%

What's inside paletteer

  1. How palettes are categorized in paletteer

    main

    Palettes in paletteer are organized into three main categories based on how they behave and how they are accessed:

    1. Discrete Fixed Width Palettes: These have a set number of colors that does not change regardless of the number of colors requested. Accessed via paletteer_d().
    2. Discrete Dynamic Palettes: The colors in the palette depend on the number of colors requested. Accessed via paletteer_dynamic().
    3. Continuous Palettes: These provide a smooth transition of color and can provide as many colors as needed. Accessed via paletteer_c().

    You can explore the available palettes using the data.frames palettes_c_names, palettes_d_names, and palettes_dynamic_names.

  2. Install paletteer

    main

    You can install the stable version of paletteer from CRAN or the development version from GitHub.

    To install from CRAN:

    install.packages("paletteer")

    To install the development version from GitHub (requires devtools):

    # install.packages("devtools")
    devtools::install_github("EmilHvitfeldt/paletteer")
    install.packages("paletteer")
  3. Access palettes using the package::palette syntax

    main

    All palettes in paletteer are accessed using a unified syntax: "packagename::palettename". The functions paletteer_c(), paletteer_d(), and paletteer_dynamic() support tab completion to help you navigate the available choices.

    • Use paletteer_c() for continuous palettes.
    • Use paletteer_d() for discrete fixed-width palettes.
    • Use paletteer_dynamic() for discrete dynamic palettes where the colors depend on the number of colors requested.
    paletteer_c("scico::berlin", n = 10)
    paletteer_d("nord::frost")
    paletteer_dynamic("cartography::green.pal", 5)
  4. Use paletteer scales with ggplot2

    main

    The package provides specialized scales for ggplot2 that follow the standard paletteer interface. You can use scale_color_paletteer_d() (for discrete) or similar scale functions to apply palettes directly to your plots.

    library(ggplot2)
    
    ggplot(iris, aes(Sepal.Length, Sepal.Width, color = Species)) +
      geom_point() +
      scale_color_paletteer_d("nord::aurora")
  5. Access palettes using paletteer_c(), paletteer_d(), and paletteer_dynamic()

    main

    All palettes are accessed using a unified syntax: "packagename::palettename".

    • Use paletteer_c() for continuous palettes.
    • Use paletteer_d() for discrete fixed-width palettes.
    • Use paletteer_dynamic() for discrete dynamic palettes.

    Note: The functions support tab completion in R to help navigate the large number of available palettes.

    # Continuous palette
    paletteer_c("scico::berlin", n = 10)
    
    # Discrete fixed-width palette
    paletteer_d("nord::frost")
    
    # Discrete dynamic palette
    paletteer_dynamic("cartography::green.pal", 5)
  6. List of included palette packages in paletteer

    main

    The paletteer package provides access to a wide variety of color palettes from many different R packages. These include palettes from CRAN-hosted packages and various GitHub-hosted packages. Below is a reference of the included packages and their sources.

    | Name | Github | CRAN |
    |:---|:---|:---|
    | ButterflyColors | [junqueiragaabi/ButterflyColors - 0.0.0.9000](https://github.com/junqueiragaabi/ButterflyColors) | - |
    | DresdenColor | [katiesaund/DresdenColor - 0.0.0.9000](https://github.com/katiesaund/DresdenColor) | - |
    | IslamicArt | [lambdamoses/IslamicArt - 0.1.0](https://github.com/lambdamoses/IslamicArt) | - |
    | LaCroixColoR | [johannesbjork/LaCroixColoR - 0.1.0](https://github.com/johannesbjork/LaCroixColoR) | - |
    | Manu | [G-Thomson/Manu - 0.0.2](https://github.com/G-Thomson/Manu) | - |
    | MapPalettes | [disarm-platform/MapPalettes - 0.0.2](https://github.com/disarm-platform/MapPalettes) | - |
    | MetBrewer | [BlakeRMills/MetBrewer - 0.3.0](https://github.com/BlakeRMills/MetBrewer) | [0.2.0](https://CRAN.R-project.org/package=MetBrewer) |
    | MexBrewer | [paezha/MexBrewer - 0.0.2](https://github.com/paezha/MexBrewer) | - |
    | MoMAColors | [BlakeRMills/MoMAColors - 0.0.0.9000](httpshttps://github.com/BlakeRMills/MoMAColors) | - |
    | NatParksPalettes | [kevinsblake/NatParksPalettes - 0.2.0](https://github.com/kevinsblake/NatParksPalettes) | [0.2.0](https://CRAN.R-project.org/package=NatParksPalettes) |
    | NineteenEightyR | [m-clark/NineteenEightyR - 0.1.0](https://github.com/m-clark/NineteenEightyR) | - |
    | PNWColors | [jakelawlor/PNWColors - 0.1.0](https://github.com/jakelawlor/PNWColors) | - |
    | Polychrome | - | [1.5.4](https://CRAN.R-project.org/package=Polychrome) |
    | PrettyCols | [nrennie/PrettyCols - 1.1.0.9003](https://github.com/nrennie/PrettyCols) | [1.1.0](https://CRAN.R-project.org/package=PrettyCols) |
    | RColorBrewer | - | [1.1.3](https://CRAN.R-project.org/package=RColorBrewer) |
    | RSkittleBrewer | [alyssafrazee/RSkittleBrewer - 1.1](https://github.com/alyssafrazee/RSkittleBrewer) | - |
    | Rdune | [nvietto/Rdune - 1.1.1.9000](https://github.com/nvietto/Rdune) | [1.1.1](https://CRAN.R-project.org/package=Rdune) |
    | Redmonder | [pmdci/redmonder - 0.2.0](https://github.com/pmdci/redmonder) | [0.2.0](https://CRAN.R-project.org/package=Redmonder) |
    | amerika | [pdwaggoner/amerika - 0.1.1](https://github.com/pdwaggoner/amerika) | [0.1.1](https://CRAN.R-project.org/package=amerika) |
    | awtools | [awhstin/awtools - 0.2.1](https://github.com/awhstin/awtools) | - |
    | basetheme | [karoliskoncevicius/basetheme - 0.1.3](https://github.com/karoliskoncevicius/basetheme) | [0.1.3](https://CRAN.R-project.org/package=basetheme) |
    | beyonce | [dill/beyonce - 0.1](https://github.com/dill/beyonce) | - |
    | blueycolors | [ekholme/blueycolors - 0.1.0](https://github.com/ekholme/blueycolors) | - |
    | calecopal | [an-bui/calecopal - 0.1.0](https://github.com/an-bui/calecopal) | - |
    | cartography | [riatelab/cartography - 3.1.5](https://github.com/riatelab/cartography) | [3.1.5](https://CRAN.R-project.org/package=cartography) |
    | colRoz | [jacintak/colRoz - 0.2.2](https://github.com/jacintak/colRoz) | - |
    | colorBlindness | - | [0.1.9](https://CRAN.R-project.org/package=colorBlindness) |
    | colorblindr | [clauswilke/colorblindr - 0.1.0](https://github.com/clauswilke/colorblindr) | - |
    | dichromat | - | [2.0-0.1](https://CRAN.R-project.org/package=dichromat) |
    | dutchmasters | [EdwinTh/dutchmasters - 0.1.0](https://github.com/EdwinTh/dutchmasters) | - |
    | feathers | [shandiya/feathers - 0.0.0.9000](https://github.com/shandiya/feathers) | - |
    | fishualize | [nschiett/fishualize - 0.2.3](https://github.com/nschiett/fishualize) | [0.2.3](https://CRAN.R-project.org/package=fishualize) |
    | futurevisions | [JoeyStanley/futurevisions - 0.1.1](https://github.com/JoeyStanley/futurevisions) | - |
    | ggpomological | [gadenbuie/ggpomological - 0.1.2](https://github.com/gadenbuie/ggpomological) | - |
    | ggprism | [csdaw/ggprism - 1.0.7.9000](https://github.com/csdaw/ggprism) | [1.0.7](https://CRAN.R-project.org/package=ggprism) |
    | ggsci | [nanxstats/ggsci - 4.2.0](https://github.com/nanxstats/ggsci) | [4.2.0](https://CRAN.R-project.org/package=ggsci) |
    | ggthemes | [jrnold/ggthemes - 5.2.0](https://github.com/jrnold/ggthemes) | [5.2.0](https://CRAN.R-project.org/package=ggthemes) |
    | ggthemr | [Mikata-Project/ggthemr - 1.1.0](https://github.com/Mikata-Project/ggthemr) | - |
    | ghibli | [ewenme/ghibli - 0.3.4](https://github.com/ewenme/ghibli) | [0.3.4](https://CRAN.R-project.org/package=ghibli) |
    | grDevices | - | 4.5.2 |
    | harrypotter | [aljrico/harrypotter - 2.1.1](https://github.com/aljrico/harrypotter) | [2.1.1](https://CRAN.R-project.org/package=harrypotter) |
    | impressionist.colors | - | [1.0](https://CRAN.R-project.org/package=impressionist.colors) |
    | jcolors | [jaredhuling/jcolors - 0.0.5](https://github.com/jaredhuling/jcolors) | - |
    | khroma | [tesselle/khroma - 1.17.0.9000](https://github.com/tesselle/khroma) | [1.17.0](https://CRAN.R-project.org/package=khroma) |
    | lisa | [tylerlittlefield/lisa - 0.1.2.9000](https://github.com/tylerlittlefield/lisa) | [0.1.2](https://CRAN.R-project.org/package=lisa) |
    | ltc | [loukesio/ltc-color-palettes - 0.2.0](https://github.com/loukesio/ltc-color-palettes) | - |
    | miscpalettes | [EmilHvitfeldt/miscpalettes - 0.0.0.9000](https://github.com/EmilHvitfeldt/miscpalettes) | - |
    | musculusColors | [dawnbarlow/musculusColors - 0.1.0](https://github.com/dawnbarlow/musculusColors) | - |
    | nationalparkcolors | [katiejolly/nationalparkcolors - 0.1.0](https://github.com/katiejolly/nationalparkcolors) | - |
    | nbapalettes | [murrayjw/nbapalettes - 0.1.0.9000](https://github.com/murrayjw/nbapalettes) | [0.1.0](https://CRAN.R-project.org/package=nbapalettes) |
    | nord | [jkaupp/nord - 1.0.0](https://github.com/jkaupp/nord) | [1.0.0](https://CRAN.R-project.org/package=nord) |
    | ochRe | [hollylkirk/ochRe - 1.0.0](https://github.com/hollylkirk/ochRe) | - |
    | oompaBase | - | [3.2.10](https://CRAN.R-project.org/package=oompaBase) |
    | palettesForR | [frareb/palettesForR - 0.1.2](https://github.com/frareb/palettesForR) | [0.1.2](https://CRAN.R-project.org/package=palettesForR) |
    | palettetown | [timcdlucas/palettetown - 0.1.1.90000](https://github.com/timcdlucas/palettetown) | [0.1.1](https://CRAN.R-project.org/package=palettetown) |
    | palr | [AustralianAntarcticDivision/palr - 0.4.0](https://github.com/AustralianAntarcticDivision/palr) | [0.4.0](https://CRAN.R-project.org/package=palr) |
    | pals | [kwstat/pals - 1.10](https://github.com/kwstat/pals) | [1.10](https://CRAN.R-project.org/package=pals) |
    | peRReo | [jbgb13/peRReo - 0.1.0](https://github.com/jbgb13/peRReo) | - |
    | poisonfrogs | [laurenoconnelllab/poisonfrogs - 1.0.2.9000](https://github.com/laurenoconnelllab/poisonfrogs) | [1.0.2](https://CRAN.R-project.org/package=poisonfrogs) |
    | popthemes | [johnmackintosh/popthemes - 0.0.0.9000](https://github.com/johnmackintosh/popthemes) | - |
    | rcartocolor | [Nowosad/rcartocolor - 2.1.2](https://github.com/Nowosad/rcartocolor) | [2.1.2](https://CRAN.R-project.org/package=rcartocolor) |
    | rockthemes | [johnmackintosh/rockthemes - 0.0.0.9000](https://github.com/johnmackintosh/rockthemes) | - |
    | rtist | [tomasokal/rtist - 1.0.0](https://github.com/tomasokal/rtist) | [1.0.0](https://CRAN.R-project.org/package=rtist) |
    | scico | [thomasp85/scico - 1.5.0.9000](https://github.com/thomasp85/scico) | [1.5.0](https://CRAN.R-project.org/package=scico) |
    | severance | [ivelasq/severance - 0.0.0.9000](https://github.com/ivelasq/severance) | - |
    | soilpalettes | [kaizadp/soilpalettes - 0.1.0](https://github.com/kaizadp/soilpalettes) | - |
    | suffrager | [alburezg/suffrager - 0.1.0](httpshttps://github.com/alburezg/suffrager) | - |
    | tayloRswift | [asteves/tayloRswift - 0.3.0](https://github.com/asteves/tayloRswift) | - |
    | tidyquant | [business-science/tidyquant - 1.0.11.9000](https://github.com/business-science/tidyquant) | [1.0.11](https://CRAN.R-project.org/package=tidyquant) |
    | trekcolors | [leonawicz/trekcolors - 0.2.0](https://github.com/leonawicz/trekcolors) | [0.2.0](https://CRAN.R-project.org/package=trekcolors) |
    | tvthemes | [Ryo-N7/tvthemes - 1.3.3](https://github.com/Ryo-N7/tvthemes) | [1.3.3](https://CRAN.R-project.org/package=tvthemes) |
    | unikn | [hneth/unikn - 1.0.0.9004](https://github.com/hneth/unikn) | [1.0.0](https://CRAN.R-project.org/package=unikn) |
    | vangogh | [cherylisabella/vangogh - 0.1.3](https://github.com/cherylisabella/vangogh) | [0.1.3](https://CRAN.R-project.org/package=vangogh) |
    | vapeplot | [seasmith/vapeplot - 0.1.0](httpshttps://github.com/seasmith/vapeplot) | - |
    | vapoRwave | [moldach/vapoRwave - 0.3.0](https://github.com/moldach/vapoRwave) | - |
    | viridis | [sjmgarnier/viridis - 0.6.5](https://github.com/sjmgarnier/viridis) | [0.6.5](https://CRAN.R-project.org/package=viridis) |
    | visibly | [m-clark/visibly - 0.2.9](https://github.com/m-clark/visibly) | - |
    | waRhol | [alexskeels/waRhol - 0.1.0](https://github.com/alexskeels/waRhol) | - |
    | werpals | [sciencificity/werpals - 0.1.0](https://github.com/sciencificity/werpals) | - |
    | wesanderson | [karthik/wesanderson - 0.3.7](https://github.com/karthik/wesanderson) | [0.3.7](https://CRAN.R-project.org/package=wesanderson) |
    | yarrr | [ndphillips/yarrr - 0.1.14](https://github.com/ndphillips/yarrr) | [NA](https://CRAN.R-project.org/package=yarrr) |
  7. Migration: Update palette selection syntax

    main

    If you are upgrading from a version $\le$ 0.2.1, the method for selecting palettes has changed.

    Old Syntax (Deprecated): Used separate package and palette arguments.

    paletteer_c(package = "nord", palette = "frost")

    New Syntax (Current): Use the "packagename::palettename" string inside the function.

    paletteer_c("nord::frost")
    paletteer_c("nord::frost")
  8. Use paletteer scales in ggplot2

    main

    You can integrate paletteer directly into ggplot2 workflows using specialized scale functions. For discrete color scales, use scale_color_paletteer_d() (or scale_fill_paletteer_d() for fills).

    library(ggplot2)
    library(paletteer)
    
    ggplot(iris, aes(Sepal.Length, Sepal.Width, color = Species)) +
      geom_point() +
      scale_color_paletteer_d("nord::aurora")
  9. Use discrete fixed-width palettes with paletteer_d()

    main

    Fixed-width discrete palettes have a set number of colors that does not change regardless of how many colors are requested. Use paletteer_d() to access them.

    Example:

    paletteer_d("nord::frost")
    paletteer_d("nord::frost")
  10. Use discrete dynamic palettes with paletteer_dynamic()

    main

    Dynamic discrete palettes change their color composition based on the number of colors requested (n). Use paletteer_dynamic() to access them.

    Example:

    # Requesting 5 colors from a dynamic palette
    paletteer_dynamic("cartography::green.pal", 5)
    paletteer_dynamic("cartography::green.pal", 5)
  11. Use continuous palettes with paletteer_c()

    main

    Continuous palettes provide a smooth transition of color and can provide as many colors as requested via the n parameter. Use paletteer_c() to access them.

    Example:

    paletteer_c("viridis::inferno", n = 256)
    paletteer_c("scico::berlin", n = 10)