Awesome
feathers
<!-- badges: start --> <!-- badges: end -->This package contains colour palettes inspired by the plumage of Australian birds. For species exhibiting sexual dimorphism (i.e. males and females look different), I have used female colours. Research on birds has historically been biased towards males, and the choice to use female colours in this package is my way of highlighting the often-overlooked beauty of female birds.
Installation
This package is hosted on GitHub and can be installed using the devtools package:
devtools::install_github(repo = "shandiya/feathers", ref = "main")
How to use feathers
Colour palettes are stored as a list called feathers_palettes
, and can
be accessed thus:
library(feathers)
names(feathers_palettes)
## [1] "spotted_pardalote" "plains_wanderer"
## [3] "bee_eater" "rose_crowned_fruit_dove"
## [5] "eastern_rosella" "oriole"
## [7] "princess_parrot" "superb_fairy_wren"
## [9] "cassowary" "yellow_robin"
## [11] "galah"
get_pal
returns the chosen palette as a vector of hex colour codes.
get_pal("eastern_rosella")
## [1] "#cd3122" "#f4c623" "#bee183" "#6c905e" "#2f533c" "#b8c9dc" "#2f7ab9"
print_pal
displays the colour palette.
eastern_rosella <- get_pal("eastern_rosella")
print_pal(eastern_rosella)
<img src="README_files/figure-gfm/unnamed-chunk-5-1.png" style="display: block; margin: auto;" />
Examples
Colour palettes can be used for data visualisation in base R
and
ggplot2
.
# base R
library(palmerpenguins)
plot(penguins$flipper_length_mm,
penguins$body_mass_g,
col = get_pal("rose_crowned_fruit_dove")[factor(penguins$species)],
pch = 19)
# ggplot2
library(ggplot2)
library(palmerpenguins)
ggplot(penguins) +
geom_point(aes(flipper_length_mm,
body_mass_g,
colour = species)) +
scale_colour_manual(values = get_pal("rose_crowned_fruit_dove"))
<img src="README_files/figure-gfm/unnamed-chunk-6-1.png" width="50%" /><img src="README_files/figure-gfm/unnamed-chunk-6-2.png" width="50%" />
Colour palettes
The images below show each palette and the bird that inspired it.
Eastern Rosella (Platycercus eximius)
<img src="README_files/figure-gfm/rosella_pal-1.png" style="display: block; margin: auto;" /><img src="images/eastern_rosella_plot.png" width="65%" /><img src="images/eastern_rosella_img.png" width="35%" />
Image: Duncan McCaskill
Plains-wanderer (Pedionomus torquatus)
<img src="README_files/figure-gfm/wanderer_pal-1.png" style="display: block; margin: auto;" /><img src="images/plains_wanderer_plot.png" width="65%" /><img src="images/plains_wanderer_img.png" width="35%" />
Image: JJ Harrison
Spotted Pardalote (Pardalotus punctatus)
<img src="README_files/figure-gfm/spotty_pal-1.png" style="display: block; margin: auto;" /><img src="images/spotted_pardalote_plot.png" width="65%" /><img src="images/spotted_pardalote_img.png" width="35%" />
Image: Patrick_K59
Rose-crowned Fruit-Dove (Ptilinopus regina)
<img src="README_files/figure-gfm/rcf_dove_pal-1.png" style="display: block; margin: auto;" /><img src="images/rose_crowned_fruit_dove_plot.png" width="65%" /><img src="images/rose_crowned_fruit_dove_img.png" width="35%" />
Image: Sheba_Also
Rainbow Bee-eater (Merops ornatus)
<img src="README_files/figure-gfm/bee_eater_pal-1.png" style="display: block; margin: auto;" /><img src="images/bee_eater_plot.png" width="65%" /><img src="images/bee_eater_img.png" width="35%" />
Image: Jim Bendon
Superb Fairy-wren (Malurus cyaneus)
<img src="README_files/figure-gfm/superb_fw_pal-1.png" style="display: block; margin: auto;" /><img src="images/superb_fairy_wren_plot.png" width="65%" /><img src="images/superb_fairy_wren_img.png" width="35%" />
Image: Patrick_K59
Princess Parrot (Polytelis alexandrae)
<img src="README_files/figure-gfm/princess_pal-1.png" style="display: block; margin: auto;" /> <img src="images/princess_parrot_plot.png" width="65%" />Olive-backed Oriole (Oriolus sagittatus)
<img src="README_files/figure-gfm/oriole_pal-1.png" style="display: block; margin: auto;" /><img src="images/oriole_plot.png" width="65%" /><img src="images/oriole_img.png" width="35%" />
Image: Patrick_K59
Southern Cassowary (Casuarius casuarius)
<img src="README_files/figure-gfm/cassowary_pal-1.png" style="display: block; margin: auto;" /><img src="images/cassowary_plot.png" width="65%" /><img src="images/cassowary_img.png" width="35%" />
Image: Nick Hobgood
Eastern Yellow Robin (Eopsaltria australis)
<img src="README_files/figure-gfm/yellow_robin_pal-1.png" style="display: block; margin: auto;" /><img src="images/yellow_robin_plot.png" width="65%" /><img src="images/yellow_robin_img.png" width="35%" />
Image: Patrick_K59
Galah (Eolophus roseicapilla)
<img src="README_files/figure-gfm/galah_pal-1.png" style="display: block; margin: auto;" /><img src="images/galah_plot.png" width="65%" /><img src="images/galah_img.png" width="35%" />
Image: Calistemon
Continuous palettes
The qualitative colour palettes in feathers
may be converted into
sequential or diverging palettes for different types of data
visualisation using the colorRampPalette()
function.
Sequential palette
# choose end colours
seq_col <- get_pal("eastern_rosella")[c(2,7)]
# create a gradient of 50 shades in between the selected colours
colorRampPalette(seq_col)(50)
<img src="README_files/figure-gfm/unnamed-chunk-8-1.png" style="display: block; margin: auto;" />
Diverging palette
# choose end and middle colours
div_col <- get_pal("oriole")[c(1,5,10)]
# create a gradient of 50 shades in between the selected colours
colorRampPalette(div_col)(50)
<img src="README_files/figure-gfm/unnamed-chunk-10-1.png" style="display: block; margin: auto;" />
Accessibility
There are many tools and packages which simulate different types of colour vision deficiency, such as Viz Palette, colorblindcheck, prismatic, and colorblindr. You may find these helpful in guiding your decisions about which colours to include in your visualisation to make it accessible to as many people as possible. Happy plotting!
Julia Port
These colour palettes are now available in Julia as part of the default colour schemes (ColorSchemes.jl). Use these colour palettes as you would any other built-in Julia colour scheme:
using ColorSchemes
colorscheme[:cassowary] # or your bird of choice
Contribute
If you would like to contribute to this package or have suggestions for improvement, please contact ShandiyaB on Twitter or submit a pull request.