colorizeString: Colorize String

Description Usage Arguments Examples

Description

Takes one or more strings as input, and generates a 24-bit hexadecimal color based on hashing the string

Usage

1
2
colorizeString(x, min = 128, max = 240, r = NA, g = NA, b = NA,
  as.html = TRUE)

Arguments

x

The string(s) to be hashed

min

Default 128. The minimum value (0-256) any RGB value can have

max

Default 240. Maximum value an RGB value can have

r

Explicit value to set for the red channel. Ignores "min" and "max". Combined with "g" and "b" allows some control over the hues generated during hashing.

g

Explict green channel value

b

Explicit blue channel value

as.html

When TRUE (default) the returned value will be hexadecimal strings suitable (eg "#aa318f"). If false, a three column ("R","G","B") array will be returned, one row per input string.

Examples

1
2
colorizeString(c("quick fox","QUICK fox", "lazy dog"))
colorizeString(c("quick fox","QUICK fox", "lazy dog"), as.html=FALSE)

maptracker/dynamictable documentation built on May 21, 2019, 11:27 a.m.