nearest_named {xkcdcolors}R Documentation

Find nearest named color to a specified color.

Description

Looks up the nearest (sufficiently popular) named color to the specified color

Usage

nearest_named(color, hex_only = FALSE, max_rank = -1, Lab=TRUE)

Arguments

color

Vector of character strings or matrix of RGB values

hex_only

if TRUE return only the hex string, otherwise all the data

max_rank

Consider only the max_rank most popular colors.

Lab

Use the 'Lab' color space if TRUE, otherwise RGB

Value

A hex string with the color, or a data frame

References

http://blog.xkcd.com/2010/05/03/color-survey-results/

Examples

nearest_named("#8f7303")
nearest_named("#8f7303",max_rank=100)
nearest_named("#8f7303",max_rank=10)

[Package xkcdcolors version 1.0 Index]