nearest_named: Find nearest named color to a specified color.

Description Usage Arguments Value References Examples

Description

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

Usage

1
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

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

Example output

    color_name     hex red green blue        L        a        b
448        poo #8f7303 143   115    3 49.66112 1.579124 55.11043
    color_name     hex red green blue        L         a        b
920      olive #6e750e 110   117   14 47.06486 -14.98247 49.39257
    color_name     hex red green blue        L        a        b
945      brown #653700 101    55    0 28.17165 16.83825 38.40762

xkcdcolors documentation built on May 2, 2019, 4:26 a.m.