Type: | Package |
Title: | Use Pokemon Inspired Colour Palettes |
Version: | 0.1.1 |
Date: | 2016-04-06 |
Author: | Tim Lucas |
Maintainer: | Tim Lucas <timcdlucas@gmail.com> |
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. |
Suggests: | ggplot2, magrittr |
Imports: | grDevices, stats, graphics |
License: | MIT + file LICENSE |
Copyright: | Pokemon, pokedex and all pokemon names are trademarks of Nintendo. |
URL: | https://github.com/timcdlucas/palettetown |
RoxygenNote: | 5.0.1 |
NeedsCompilation: | no |
Packaged: | 2016-04-06 19:53:39 UTC; tim |
Repository: | CRAN |
Date/Publication: | 2016-04-07 01:01:15 |
Pokemon inspired colour palettes.
Description
Pokemon inspired colour palettes.
Author(s)
Tim CD Lucas
Get a pokemon palette. Alias for pokepal.
Description
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)
Usage
ichooseyou(pokemon = 1, spread = NULL)
Arguments
pokemon |
An integer or character pokemon name |
spread |
How many, quite distinct, colours should be returned. See details. |
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.
See Also
Examples
library(magrittr)
pal <- 'Hoothoot' %>% ichooseyou
pal2 <- 'Pichu' %>% ichooseyou(6)
Display pokemon palettes.
Description
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.
Usage
pokedex(pokemon = NULL, spread = NULL, cb = NULL)
Arguments
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. |
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.
Thanks to Luis Verde for the colourblind suitable selection.
Examples
pokedex()
pokedex('Metapod')
pokedex(5, spread = 2)
pokedex(cb = 3)
pokedex(cb = 2, spread = 6)
Get a pokemon palette.
Description
Get a pokemon (R) palette by either giving a pokemon number or name.
Usage
pokepal(pokemon = 1, spread = NULL)
Arguments
pokemon |
An integer or character pokemon name |
spread |
How many, quite distinct, colours should be returned. See details. |
Details
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.
See Also
Examples
pal <- pokepal(3)
plot(1:length(pal), col = pal)
Add a pokemon palette to a ggplot2 colour or fill scale.
Description
Get a pokemon palette by either giving a pokemon number or name.
Usage
scale_colour_poke(..., pokemon = 1, spread = NULL)
scale_fill_poke(..., pokemon = 1, spread = NULL)
scale_color_poke(..., pokemon = 1, spread = NULL)
Arguments
... |
Other arguments passed on to |
pokemon |
An integer or character pokemon name |
spread |
How many, quite distinct, colours should be returned. See details. |
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.
Examples
library(ggplot2)
qplot(Sepal.Length, Sepal.Width, colour = Species, data=iris) +
scale_colour_poke(pokemon = 'Metapod')