get_hex: Create a function that returns hex codes

Description Usage Arguments Value Examples

View source: R/get_hex.R

Description

Will return a function that returns the hex codes from the character vector provided. The names of the character vectors can be queried.

Usage

1
get_hex(color_vec)

Arguments

color_vec

A named character vector with hex codes.

Value

A function from which the hex codes can be queried by typing their bare, unquoted name.

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
milkmaid_hex <- get_hex(dutchmasters::dutchmasters$milkmaid)
milkmaid_hex(blue(skirt), yellow(buste))

library(ggplot2)
ggplot(data.frame(x = rnorm(100),
                  y = rexp(100),
                  z = rep(letters[1:2], 50)),
       aes(x, y, col = z)) +
 geom_point(size = 3) +
 scale_color_manual(values = milkmaid_hex(blue(skirt), yellow(buste)))

EdwinTh/paletti documentation built on May 13, 2019, 10:59 p.m.