Title: | Color Palettes from Crayon Boxes |
---|---|
Description: | Provides color palettes based on crayon colors since the early 1900s. Colors are based on various crayon colors, sets, and promotional palettes, most of which can be found at <https://en.wikipedia.org/wiki/List_of_Crayola_crayon_colors>. All palettes are discrete palettes and are not necessarily color-blind friendly. Provides scales for 'ggplot2' for discrete coloring. |
Authors: | Christopher T. Kenny [aut, cre]
|
Maintainer: | Christopher T. Kenny <[email protected]> |
License: | MIT + file LICENSE |
Version: | 0.0.3 |
Built: | 2024-08-24 04:14:42 UTC |
Source: | https://github.com/christopherkenny/crayons |
Crayon colors, based on common Crayola colors. Palettes build from Wikipedia
crayons
crayons
list of palette::palette vectors
Included palettes:
billionth, celebrates the 100 billionth crayon
color_n_smell, scented colors
colors_of_the_world, additional human colors
construction_paper, colors for construction paper
fluorescent, neon colors
gel_fx, gel colors
gem_tones, gemstones
heads_n_tails, double sided colors
magic_scent, scented colors
metallic_fx, metal colors
mini_twistables, colors, but twistable
modern, historical colors since 1990
munsell, historical colors 1926-1944
multicultural, skin colors
no_48, historical crayons 48-pack in 1949
no_64, historical crayons 64-pack in 1958
original, historical crayons original in 1903
pearl, updated perlescent colors
pearl_brite, pearlescent colors
silly_scents, scented in reality but not in R
silver_swirls, colors with a tinge of silver
standard, a large set of standard colors
standard16, colors for a 16 pack of crayons
standard24, colors for a 24 pack of crayons
standard32, colors for a 32 pack of crayons
standard64, colors for a 64 pack of crayons
star_brite, colors from 1997
plot(crayons$billionth) plot(crayons$color_n_smell) plot(crayons$colors_of_the_world) plot(crayons$construction_paper) plot(crayons$fluorescent) plot(crayons$gel_fx) plot(crayons$gem_tones) plot(crayons$heads_n_tails) plot(crayons$magic_scent) plot(crayons$metallic_fx) plot(crayons$mini_twistables) plot(crayons$modern) plot(crayons$munsell) plot(crayons$multicultural) plot(crayons$no_48) plot(crayons$no_64) plot(crayons$original) plot(crayons$pearl) plot(crayons$pearl_brite) plot(crayons$silly_scents) plot(crayons$silver_swirls) plot(crayons$standard) plot(crayons$standard16) plot(crayons$standard24) plot(crayons$standard32) plot(crayons$standard64) plot(crayons$star_brite)
plot(crayons$billionth) plot(crayons$color_n_smell) plot(crayons$colors_of_the_world) plot(crayons$construction_paper) plot(crayons$fluorescent) plot(crayons$gel_fx) plot(crayons$gem_tones) plot(crayons$heads_n_tails) plot(crayons$magic_scent) plot(crayons$metallic_fx) plot(crayons$mini_twistables) plot(crayons$modern) plot(crayons$munsell) plot(crayons$multicultural) plot(crayons$no_48) plot(crayons$no_64) plot(crayons$original) plot(crayons$pearl) plot(crayons$pearl_brite) plot(crayons$silly_scents) plot(crayons$silver_swirls) plot(crayons$standard) plot(crayons$standard16) plot(crayons$standard24) plot(crayons$standard32) plot(crayons$standard64) plot(crayons$star_brite)
pick_colors()
places each color into RGB space, clusters them with k-means,
and returns the colors nearest each cluster center.
color_order()
reorders colors so that subsequent colors are far from each other
in RGB space.
color_distance()
calculates pairwise distances in RGB space between colors.
pick_colors(hex, n) color_distance(hex) color_order(hex)
pick_colors(hex, n) color_distance(hex) color_order(hex)
hex |
a character vector of hexadecimal colors |
n |
the integer number of desired colors |
a character vector that is a subset of hex
, or a
matrix of distances for color_distance()
pick_colors(crayons$standard, 10) color_order(crayons$standard) color_distance(crayons$standard[1:4])
pick_colors(crayons$standard, 10) color_order(crayons$standard) color_distance(crayons$standard[1:4])
ggplot2
Crayon Color Scales for ggplot2
scale_color_crayons(palette = "standard16", which = NULL, ..., reverse = FALSE) scale_fill_crayons(palette = "standard16", which = NULL, ..., reverse = FALSE) scale_colour_crayons( palette = "standard16", which = NULL, ..., reverse = FALSE )
scale_color_crayons(palette = "standard16", which = NULL, ..., reverse = FALSE) scale_fill_crayons(palette = "standard16", which = NULL, ..., reverse = FALSE) scale_colour_crayons( palette = "standard16", which = NULL, ..., reverse = FALSE )
palette |
palette from |
which |
numeric indices of colors to use. |
... |
arguments passed on to |
reverse |
Should the vector be reversed? Default is |
library(ggplot2) ggplot2::mpg |> ggplot() + geom_point(aes(displ, hwy, colour = class)) + scale_color_crayons(palette = 'original') ggplot2::mpg |> ggplot() + geom_point(aes(displ, hwy, fill = class), pch = 23, color = 'transparent') + scale_fill_crayons(palette = 'original')
library(ggplot2) ggplot2::mpg |> ggplot() + geom_point(aes(displ, hwy, colour = class)) + scale_color_crayons(palette = 'original') ggplot2::mpg |> ggplot() + geom_point(aes(displ, hwy, fill = class), pch = 23, color = 'transparent') + scale_fill_crayons(palette = 'original')