Title: | Color Names from the XKCD Color Survey |
---|---|
Description: | The XKCD color survey asked participants to name colours. Randall Munroe published the top thousand(roughly) names and their sRGB hex values. This package lets you use them. |
Authors: | Thomas Lumley, using data from Randall Munroe and about 2.2e5 survey participants |
Maintainer: | Thomas Lumley <[email protected]> |
License: | MIT + file LICENSE |
Version: | 1.0 |
Built: | 2024-11-11 04:44:20 UTC |
Source: | https://github.com/tslumley/xkcdcolors |
The XKCD color survey asked participants to name colours. Randall Munroe published the top thousand(roughly) names and their sRGB hex values. This package lets you use them.
The DESCRIPTION file:
Package: | xkcdcolors |
Type: | Package |
Title: | Color Names from the XKCD Color Survey |
Version: | 1.0 |
Author: | Thomas Lumley, using data from Randall Munroe and about 2.2e5 survey participants |
Maintainer: | Thomas Lumley <[email protected]> |
Description: | The XKCD color survey asked participants to name colours. Randall Munroe published the top thousand(roughly) names and their sRGB hex values. This package lets you use them. |
Imports: | grDevices, FNN |
License: | MIT + file LICENSE |
Repository: | https://tslumley.r-universe.dev |
RemoteUrl: | https://github.com/tslumley/xkcdcolors |
RemoteRef: | HEAD |
RemoteSha: | 33bfe10f77051d29267755734a47704a5e329bf7 |
Index of help topics:
name2color Look up a color by name nearest_named Find nearest named color to a specified color. xcolors List the XKCD survey colors xkcdcolors-package Color Names from the XKCD Color Survey
Thomas Lumley, using data from Randall Munroe and about 2.2e5 survey participants
Maintainer: Thomas Lumley <[email protected]>
http://blog.xkcd.com/2010/05/03/color-survey-results/
Look up a color by exact or partial name.
name2color(name, exact = TRUE, hex_only = TRUE, n = -1)
name2color(name, exact = TRUE, hex_only = TRUE, n = -1)
name |
Character string giving color name |
exact |
If |
hex_only |
If |
n |
For partial matching, limit the results to the |
A character string with a hex color code, or a data frame
Thomas Lumley
http://blog.xkcd.com/2010/05/03/color-survey-results/
name2color("green") name2color("green",exact=FALSE,hex_only=FALSE,n=10) barplot(rep(1,10), col=name2color("green",exact=FALSE,n=10))
name2color("green") name2color("green",exact=FALSE,hex_only=FALSE,n=10) barplot(rep(1,10), col=name2color("green",exact=FALSE,n=10))
Looks up the nearest (sufficiently popular) named color to the specified color
nearest_named(color, hex_only = FALSE, max_rank = -1, Lab=TRUE)
nearest_named(color, hex_only = FALSE, max_rank = -1, Lab=TRUE)
color |
Vector of character strings or matrix of RGB values |
hex_only |
if |
max_rank |
Consider only the |
Lab |
Use the 'Lab' color space if |
A hex string with the color, or a data frame
http://blog.xkcd.com/2010/05/03/color-survey-results/
nearest_named("#8f7303") nearest_named("#8f7303",max_rank=100) nearest_named("#8f7303",max_rank=10)
nearest_named("#8f7303") nearest_named("#8f7303",max_rank=100) nearest_named("#8f7303",max_rank=10)
Lists (a subset of) the 949 colors consistently identified in the XKCD web color survey.
xcolors(max_rank = -1)
xcolors(max_rank = -1)
max_rank |
If positive, restrict to the top (most frequently named) |
Vector of character strings
http://blog.xkcd.com/2010/05/03/color-survey-results/
xcolors(10) name2color(xcolors(10)) barplot(rep(1,10),col=name2color(xcolors(10)))
xcolors(10) name2color(xcolors(10)) barplot(rep(1,10),col=name2color(xcolors(10)))