Package 'palettetown'

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

Help Index


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, extra = NULL)

Arguments

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)

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

pokepal

Examples

library(magrittr)
pal <- 'Hoothoot' %>% ichooseyou
pal2 <- 'Pichu' %>% ichooseyou(6)

Pokemon inspired colour palettes.

Description

Pokemon inspired colour palettes.

Author(s)

Tim CD Lucas


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, extra = 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. pokemon is ignored if used, but spread works as normal.

extra

f an integer, show the extra palettes starting from that number

Details

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.

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, extra = NULL)

Arguments

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)

Details

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.

See Also

ichooseyou

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 discrete_scale to control name, limits, breaks, labels and so forth.

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')

Combine colours from different pokemon.

Description

Combine colours from different pokemon.

Usage

team(pokemon, n = 1, spread = NULL)

Arguments

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, n is ignored.