got: Game of Thrones Colour Map.

Description Usage Arguments Details Value Author(s) Examples

View source: R/got_palette.R

Description

This function creates a vector of n equally spaced colors along the 'got colour map'.

Usage

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
gotMap(
  n = 256,
  alpha = 1,
  begin = 0,
  end = 1,
  direction = 1,
  option = "Daenerys"
)

got(n, alpha = 1, begin = 0, end = 1, direction = 1, option = "Daenerys")

got_pal(alpha = 1, begin = 0, end = 1, direction = 1, option = "Daenerys")

gameofthrones(
  n,
  alpha = 1,
  begin = 0,
  end = 1,
  direction = 1,
  option = "Daenerys"
)

Arguments

n

The number of colors (≥ 1) to be in the palette.

alpha

The alpha transparency, a number in [0,1], see argument alpha in hsv.

begin

The (corrected) hue in [0,1] at which the got colormap begins.

end

The (corrected) hue in [0,1] at which the got colormap ends.

direction

Sets the order of colors in the scale. If 1, the default, colors are ordered from darkest to lightest. If -1, the order of colors is reversed.

option

A character string indicating the colourmap to use. It is not case-sensible

Details

Here are the color scales:

houses: style=

Semi-transparent colors (0 < alpha < 1) are supported only on some devices: see rgb.

Value

got returns a character vector, cv, of color hex codes. This can be used either to create a user-defined color palette for subsequent graphics by palette(cv), a col = specification in graphics functions or in par.

gotMap returns a n lines data frame containing the red (R), green (G), blue (B) and alpha (alpha) channels of n equally spaced colors along the 'Game of Thrones' colour map. n = 256 by default.

Author(s)

Alejandro Jiménez Rico aljrico@gmail.com, Personal Blog

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
library(ggplot2)
library(hexbin)

dat <- data.frame(x = rnorm(1e4), y = rnorm(1e4))

ggplot(dat, aes(x = x, y = y)) +
  geom_hex() + coord_fixed() +
  scale_fill_gradientn(colours = got(128, option = "targaryen")) +
  theme_minimal()

pal <- got(256, option = "Wildfire")
image(volcano, col = pal)

gameofthrones documentation built on March 26, 2020, 6:28 p.m.