Title: | Color Palettes Inspired by National Parks |
---|---|
Description: | Color palettes for data visualization inspired by National Parks. Currently contains 15 color schemes and checks for colorblind-friendliness of palettes. |
Authors: | Kevin Blake [aut, cre] |
Maintainer: | Kevin Blake <[email protected]> |
License: | MIT + file LICENSE |
Version: | 0.2.0 |
Built: | 2025-03-08 05:31:57 UTC |
Source: | https://github.com/kevinsblake/natparkspalettes |
Lists all palettes that are colorblind-friendly in the package.
To be colorblind-friendly, all colors in the palettes must be distinguishable with deuteranopia, protanopia, and tritanopia.
Use natparks.pals
to construct palettes or colorblind.friendly
to test for colorblind-friendliness.
colorblind_palettes
colorblind_palettes
An object of class character
of length 12.
Checks whether a palette is colorblind-friendly. Colorblind-friendliness tested using the 'colorblindcheck' package. To be colorblind-friendly, all colors in the palettes must be distinguishable with deuteranopia, protanopia, and tritanopia.
colorblind.friendly(palette_name)
colorblind.friendly(palette_name)
palette_name |
Name of Palette. Choices are:
|
TRUE/FALSE value whether palette is colorblind-friendly
colorblind.friendly("DeathValley")
colorblind.friendly("DeathValley")
Function for viewing all palettes available in NatParksPalettes.
display_all( n, sequential = FALSE, colorblind_only = FALSE, direction = 1, override.order = FALSE )
display_all( n, sequential = FALSE, colorblind_only = FALSE, direction = 1, override.order = FALSE )
n |
Number of requested colors. If n is left blank, default palette is returned. |
sequential |
Should palettes displayed all at once, or one at a time. Default is all at once (FALSE). |
colorblind_only |
Should only colorblind friendly palettes be returned? Default is set to FALSE. |
direction |
Sets order of colors. Default palette is 1. If direction is -1, palette color order is reversed |
override.order |
Colors are picked from palette to maximize readability and aesthetics. This means that colors are not always selected in sequential order from the full palette. If override.order is set to TRUE, colors are selected in sequential order from the full palette instead. Default is FALSE. |
Plot of all color palettes available
# All Palettes display_all(sequential = FALSE, colorblind_only = FALSE) # All Colorblind Palettes display_all(sequential = FALSE, colorblind_only = TRUE) # 5 Colors of all Palettes display_all(5, sequential = FALSE, colorblind_only = FALSE)
# All Palettes display_all(sequential = FALSE, colorblind_only = FALSE) # All Colorblind Palettes display_all(sequential = FALSE, colorblind_only = TRUE) # 5 Colors of all Palettes display_all(5, sequential = FALSE, colorblind_only = FALSE)
Color palettes inspired by National Parks. Complete list of palette colors and the parks that
inspired them can be found on Github.
Use colorblind.friendly
to check whether palettes are colorblind-friendly.
natparks.pals( name, n, type = c("discrete", "continuous"), direction = c(1, -1), override.order = FALSE )
natparks.pals( name, n, type = c("discrete", "continuous"), direction = c(1, -1), override.order = FALSE )
name |
Name of Palette. Choices are:
|
n |
Number of desired colors. If number of requested colors is beyond the scope of the palette, colors are automatically interpolated. If n is not provided, the length of the palette is used. |
type |
Either "continuous" or "discrete". Use continuous if you want to automatically interpolate between colors. |
direction |
Sets order of colors. Default palette is 1. If direction is -1, palette color order is reversed |
override.order |
Colors are picked from palette to maximize readability and aesthetics. This means that colors are not always selected in sequential order from the full palette. If override.order is set to TRUE, colors are selected in sequential order from the full palette instead. Default is FALSE. |
A vector of colors.
natparks.pals("Yellowstone") natparks.pals("Glacier", direction=-1) natparks.pals("DeathValley", 4, override.order=TRUE) library(ggplot2) ggplot(data=iris, aes(x=Species, y=Petal.Length, fill=Species)) + geom_violin() + scale_fill_manual(values=natparks.pals("Yellowstone", 3)) ggplot(data=iris, aes(x=Sepal.Length, y=Sepal.Width, color=Species)) + geom_point(size=2) + scale_color_manual(values=natparks.pals("Banff", 3)) ggplot(data=iris, aes(x=Species, y=Sepal.Width, color=Sepal.Width)) + geom_point(size=3) + scale_color_gradientn(colors=natparks.pals("Arches2"))
natparks.pals("Yellowstone") natparks.pals("Glacier", direction=-1) natparks.pals("DeathValley", 4, override.order=TRUE) library(ggplot2) ggplot(data=iris, aes(x=Species, y=Petal.Length, fill=Species)) + geom_violin() + scale_fill_manual(values=natparks.pals("Yellowstone", 3)) ggplot(data=iris, aes(x=Sepal.Length, y=Sepal.Width, color=Species)) + geom_point(size=2) + scale_color_manual(values=natparks.pals("Banff", 3)) ggplot(data=iris, aes(x=Species, y=Sepal.Width, color=Sepal.Width)) + geom_point(size=3) + scale_color_gradientn(colors=natparks.pals("Arches2"))
Use names(NatParksPalettes) to return all possible palette names. Current choices are:
Acadia
, Arches
, Arches2
, Banff
, Bryce Canyon
,
CapitolReef
, Charmonix
, Cuyahoga
, DeathValley
, Denali
,
Everglades
, Glacier
, GrandCanyon
, Halekala
, IguazuFalls
,
KingsCanyon
, LakeNakuru
, Olympic
, Redwood
, RockyMtn
,
Saguaro
, SmokyMtns
, SouthDowns
, Torres
, Triglav
,
WindCave
, Volcanoes
, Yellowstone
, and Yosemite
.
Use natparks.pals
to construct palettes.
NatParksPalettes
NatParksPalettes
An object of class list
of length 30.
Function for using NatParksPalettes
colors schemes in ggplot2
. Use scale_color_natparks_d
and scale_fill_natparks_d
for discrete scales and scale_color_natparks_c
and scale_fill_natparks_c
for continuous scales.
scale_color_natparks_c(name, direction = 1, ...)
scale_color_natparks_c(name, direction = 1, ...)
name |
Name of Palette. Choices are:
|
direction |
Sets order of colors. Default palette is 1. If direction is -1, palette color order is reversed |
... |
Other arguments passed on to |
A function that returns a continuous color scale.
library(ggplot2) ggplot(data=iris, aes(x=Sepal.Length, y=Sepal.Width, color=Sepal.Length)) + geom_point() + scale_color_natparks_c("Arches2", direction=-1)
library(ggplot2) ggplot(data=iris, aes(x=Sepal.Length, y=Sepal.Width, color=Sepal.Length)) + geom_point() + scale_color_natparks_c("Arches2", direction=-1)
Function for using NatParksPalettes
colors schemes in ggplot2
. Use scale_color_natparks_d
and scale_fill_natparks_d
for discrete scales and scale_color_natparks_c
and scale_fill_natparks_c
for continuous scales.
scale_color_natparks_d(name, direction = 1, override.order = FALSE, ...)
scale_color_natparks_d(name, direction = 1, override.order = FALSE, ...)
name |
Name of Palette. Choices are:
|
direction |
Sets order of colors. Default palette is 1. If direction is -1, palette color order is reversed |
override.order |
Colors are picked from palette to maximize readability and aesthetics. This means that colors are not always selected in sequential order from the full palette. If override.order is set to TRUE, colors are selected in sequential order from the full palette instead. Default is FALSE. |
... |
Other arguments passed on to |
A function that returns a discrete color scale.
library(ggplot2) ggplot(data=iris, aes(x=Sepal.Length, y=Sepal.Width, color=Species)) + geom_point() + scale_color_natparks_d("SmokyMtns")
library(ggplot2) ggplot(data=iris, aes(x=Sepal.Length, y=Sepal.Width, color=Species)) + geom_point() + scale_color_natparks_d("SmokyMtns")
Function for using NatParksPalettes
colors schemes in ggplot2
. Use scale_color_natparks_d
and scale_fill_natparks_d
for discrete scales and scale_color_natparks_c
and scale_fill_natparks_c
for continuous scales.
scale_colour_natparks_c(name, direction = 1, ...)
scale_colour_natparks_c(name, direction = 1, ...)
name |
Name of Palette. Choices are:
|
direction |
Sets order of colors. Default palette is 1. If direction is -1, palette color order is reversed |
... |
Other arguments passed on to |
A function that returns a continuous colour scale.
library(ggplot2) ggplot(data=iris, aes(x=Sepal.Length, y=Sepal.Width, color=Sepal.Length)) + geom_point() + scale_colour_natparks_c("Arches2", direction=-1)
library(ggplot2) ggplot(data=iris, aes(x=Sepal.Length, y=Sepal.Width, color=Sepal.Length)) + geom_point() + scale_colour_natparks_c("Arches2", direction=-1)
Function for using NatParksPalettes
colors schemes in ggplot2
. Use scale_color_natparks_d
and scale_fill_natparks_d
for discrete scales and scale_color_natparks_c
and scale_fill_natparks_c
for continuous scales.
scale_colour_natparks_d(name, direction = 1, override.order = FALSE, ...)
scale_colour_natparks_d(name, direction = 1, override.order = FALSE, ...)
name |
Name of Palette. Choices are:
|
direction |
Sets order of colors. Default palette is 1. If direction is -1, palette color order is reversed |
override.order |
Colors are picked from palette to maximize readability and aesthetics. This means that colors are not always selected in sequential order from the full palette. If override.order is set to TRUE, colors are selected in sequential order from the full palette instead. Default is FALSE. |
... |
Other arguments passed on to |
A function that returns a discrete colour scale.
library(ggplot2) ggplot(data=iris, aes(x=Sepal.Length, y=Sepal.Width, color=Species)) + geom_point() + scale_colour_natparks_d("Yellowstone")
library(ggplot2) ggplot(data=iris, aes(x=Sepal.Length, y=Sepal.Width, color=Species)) + geom_point() + scale_colour_natparks_d("Yellowstone")
Function for using NatParksPalettes
colors schemes in ggplot2
. Use scale_color_natparks_d
and scale_fill_natparks_d
for discrete scales and scale_color_natparks_c
and scale_fill_natparks_c
for continuous scales.
scale_fill_natparks_c(name, direction = 1, ...)
scale_fill_natparks_c(name, direction = 1, ...)
name |
Name of Palette. Choices are:
|
direction |
Sets order of colors. Default palette is 1. If direction is -1, palette color order is reversed |
... |
Other arguments passed on to |
A function that returns a continuous color scale.
Function for using NatParksPalettes
colors schemes in ggplot2
. Use scale_color_natparks_d
and scale_fill_natparks_d
for discrete scales and scale_color_natparks_c
and scale_fill_natparks_c
for continuous scales.
scale_fill_natparks_d(name, direction = 1, override.order = FALSE, ...)
scale_fill_natparks_d(name, direction = 1, override.order = FALSE, ...)
name |
Name of Palette. Choices are:
|
direction |
Sets order of colors. Default palette is 1. If direction is -1, palette color order is reversed |
override.order |
Colors are picked from palette to maximize readability and aesthetics. This means that colors are not always selected in sequential order from the full palette. If override.order is set to TRUE, colors are selected in sequential order from the full palette instead. Default is FALSE. |
... |
Other arguments passed on to |
A function that returns a discrete color scale.
library(ggplot2) ggplot(data=iris, aes(x=Species, y=Sepal.Length, fill=Species)) + geom_violin() + scale_fill_natparks_d("KingsCanyon")
library(ggplot2) ggplot(data=iris, aes(x=Species, y=Sepal.Length, fill=Species)) + geom_violin() + scale_fill_natparks_d("KingsCanyon")