Title: | Use Pokemon Inspired Colour Palettes |
---|---|
Description: | Use Pokemon(R) inspired palettes with additional 'ggplot2' scales. Palettes are the colours in each Pokemon's sprite, ordered by how common they are in the image. The first 386 Pokemon are currently provided. |
Authors: | Tim Lucas |
Maintainer: | Tim Lucas <[email protected]> |
License: | MIT + file LICENSE |
Version: | 0.1.1.90000 |
Built: | 2025-01-19 05:15:52 UTC |
Source: | https://github.com/timcdlucas/palettetown |
Get a pokemon palette by either giving a pokemon number or name.
The recomended syntax for this function is
'Magikarp' %>% ichooseyou using the pipe operator %>%
from the magrittr package.
To specify the spread
parameter use
'Snorlax' %>% ichooseyou(5)
ichooseyou(pokemon = 1, spread = NULL, extra = NULL)
ichooseyou(pokemon = 1, spread = NULL, extra = NULL)
pokemon |
An integer or character pokemon name |
spread |
How many, quite distinct, colours should be returned. See details. |
extra |
If an integer, select one of the extra palettes (i.e. not based on individual pokemon) |
If spread
is given an integer, the full palette is
clustered into that many groups (ward clustering in HSV space).
The most common colour in each cluster is then returned. It is
hoped this will give a good balance between reflecting the pokemons
colouring while giving relatively distinct colours.
library(magrittr) pal <- 'Hoothoot' %>% ichooseyou pal2 <- 'Pichu' %>% ichooseyou(6)
library(magrittr) pal <- 'Hoothoot' %>% ichooseyou pal2 <- 'Pichu' %>% ichooseyou(6)
Pokemon inspired colour palettes.
Tim CD Lucas
Display 10 pokemon palettes starting from a name or number. If no name or number is given, 10 of the better palettes are displayed. Pokedex is a Trademark of Nintendo.
pokedex(pokemon = NULL, spread = NULL, cb = NULL, extra = NULL)
pokedex(pokemon = NULL, spread = NULL, cb = NULL, extra = NULL)
pokemon |
An integer or character pokemon name |
spread |
How many, quite distinct, colours should be returned. See details. |
cb |
A number between 1 and 4 to select ten of 40 colourblind friendly
(Deuteranomaly) palettes. |
extra |
f an integer, show the extra palettes starting from that number |
Many of the pure pokemon palettes are not great. I have manually created a few "extra" palettes (e.g., teamrocket). These might be easier to use.
If spread
is given an integer, the full palette is
clustered into that many groups (ward clustering in HSV space).
The most common colour in each cluster is then returned. It is
hoped this will give a good balance between reflecting the pokemons
colouring while giving relatively distinct colours.
Thanks to Luis Verde for the colourblind suitable selection.
pokedex() pokedex('Metapod') pokedex(5, spread = 2) pokedex(cb = 3) pokedex(cb = 2, spread = 6)
pokedex() pokedex('Metapod') pokedex(5, spread = 2) pokedex(cb = 3) pokedex(cb = 2, spread = 6)
Get a pokemon (R) palette by either giving a pokemon number or name.
pokepal(pokemon = 1, spread = NULL, extra = NULL)
pokepal(pokemon = 1, spread = NULL, extra = NULL)
pokemon |
An integer or character pokemon name |
spread |
How many, quite distinct, colours should be returned. See details. |
extra |
If an integer, select one of the extra palettes (i.e. not based on individual pokemon) |
Many of the pure pokemon palettes are not great. I have manually created a few "extra" palettes (e.g., teamrocket). These might be easier to use.
If spread
is given an integer, the full palette is
clustered into that many groups (ward clustering in HSV space, using
only hue and downweighted saturation).
The most common colour in each cluster is then returned. It is
hoped this will give a good balance between reflecting the pokemons
colouring while giving relatively distinct colours.
A few pokemon have odd names. Argument pokemon
ignores letter case.
Female and Male Nidoran are named NidoranF and NidoranM respectively.
Mr. Mime should be either 'Mr. Mime' or 'mr. mime'. The full stop and space
are needed.
pal <- pokepal(3) plot(1:length(pal), col = pal)
pal <- pokepal(3) plot(1:length(pal), col = pal)
Get a pokemon palette by either giving a pokemon number or name.
scale_colour_poke(..., pokemon = 1, spread = NULL) scale_fill_poke(..., pokemon = 1, spread = NULL) scale_color_poke(..., pokemon = 1, spread = NULL)
scale_colour_poke(..., pokemon = 1, spread = NULL) scale_fill_poke(..., pokemon = 1, spread = NULL) scale_color_poke(..., pokemon = 1, spread = NULL)
... |
Other arguments passed on to |
pokemon |
An integer or character pokemon name |
spread |
How many, quite distinct, colours should be returned. See details. |
If spread
is given an integer, the full palette is
clustered into that many groups (ward clustering in HSV space).
The most common colour in each cluster is then returned. It is
hoped this will give a good balance between reflecting the pokemons
colouring while giving relatively distinct colours.
library(ggplot2) qplot(Sepal.Length, Sepal.Width, colour = Species, data=iris) + scale_colour_poke(pokemon = 'Metapod')
library(ggplot2) qplot(Sepal.Length, Sepal.Width, colour = Species, data=iris) + scale_colour_poke(pokemon = 'Metapod')
Combine colours from different pokemon.
team(pokemon, n = 1, spread = NULL)
team(pokemon, n = 1, spread = NULL)
pokemon |
A vector of integers or a character vector of pokemon name |
n |
How many colours per pokemon? |
spread |
How many, fairly distinct, colours should be returned for each pokemon.
If not null, |